require(["esri/layers/MosaicRule"], function(MosaicRule) { /* code goes here */ });
Description
(Added at v2.0)
Specifies the mosaic rule when defining how individual images should be mosaicked. It specifies selection, mosaic method, sort order, overlapping pixel resolution, etc. Mosaic rules are for mosaicking rasters in the mosaic dataset.
A mosaic rule is used to define:
- The selection of rasters that will participate in the mosaic (using where clause).
- The mosaic method, e.g., how the selected rasters are ordered.
- The mosaic operation, e.g., how overlapping pixels at the same location are resolved.
Samples
Search for
samples that use this class.
Constructors
Constants
METHOD_ATTRIBUTE | Sorts rasters based on an attribute field and its difference from a base value. All mosaic operations apply (see operation constants). |
METHOD_CENTER | Sorts rasters where rasters that have their centers closest to the view center or center of view extent are placed on top. All mosaic operations apply (see operation constants). |
METHOD_LOCKRASTER | Specifies that only rasters in the given list of raster Ids participate in the mosaic. All mosaic operations apply (see operation constants). |
METHOD_NADIR | Sorts rasters by the distance between the nadir position and view center. This is similar to the METHOD_CENTER but uses the nadir point to a raster, which may be different than the center, especially for oblique imagery. All mosaic operations apply (see operation constants). |
METHOD_NONE | No mosaic method specified. |
METHOD_NORTHWEST | Sorts rasters in a view independent way, where rasters with their centers most northwest are displayed on top. All mosaic operations apply (see operation constants). |
METHOD_SEAMLINE | Cuts the raster using the predefined seamline shape. Optional feathering is used along the seams. The ordering is predefined during seamline generation. The First, Blend, Min, Max and Mean raster operations apply (see operation constants). |
METHOD_VIEWPOINT | Sorts rasters based on a user-defined viewpoint location and nadir location. All mosaic operations apply (see operation constants). |
OPERATION_BLEND | Takes the blended value of all overlapping pixels. |
OPERATION_FIRST | Takes the first value of all overlapping pixels. |
OPERATION_LAST | Takes the last value of all overlapping pixels. |
OPERATION_MAX | Takes the maximum value of all overlapping pixels. |
OPERATION_MEAN | Takes the mean value of all overlapping pixels. |
OPERATION_MIN | Takes the minimum value of all overlapping pixels. |
OPERATION_SUM | Takes the sum of all overlapping pixels. |
Properties
ascending | Boolean | Indicates whether the sort should be ascending or not. |
lockRasterIds | Number[] | An array of raster Ids. |
method | String | The mosaic method determines how the selected rasters are ordered. |
multidimensionalDefinition | DimensionalDefinition[] | A multiple dimensional service can have multiple variables and multiple dimensions. |
objectIds | Number[] | Defines a selection using a set of ObjectIds. |
operation | String | Defines the mosaic operation used to resolve overlapping pixels. |
sortField | String | The name of the attribute field that is used together with a constant sortValue to define the mosaicking order when the mosaic method is set to METHOD_ATTRIBUTE. |
sortValue | String | A constant value defining a reference or base value for the sort field when the mosaic method is set to METHOD_ATTRIBUTE. |
viewpoint | Point | Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters. |
where | String | The where clause determines which rasters will participate in the mosaic. |
Methods
toJson() | Object | Returns an easily serializable object representation of the mosaic rule. |
Constructor Details
Creates a new MosaicRule object
Sample:
require([
"esri/layers/MosaicRule", ...
], function(MosaicRule, ... ) {
var mr = new MosaicRule();
...
});
Create a new mosaic rule object using a json string representing a serialized version of the mosaic rule. (Added at v3.5)
Parameters:
<Object > json |
Required |
A json string representing a serialized version of the mosaic rule. |
Property Details
Indicates whether the sort should be ascending or not. This property applies to all mosaic methods where an ordering is defined except METHOD_SEAMLINE.
Known values: true | false
An array of raster Ids. All the rasters with the given list of raster Ids are selected to participate in the mosaic. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel size range of the locked rasters.
Sample:
require([
"esri/layers/MosaicRule", ...
], function(MosaicRule, ... ) {
var mr = new MosaicRule();
mr.method = MosaicRule.METHOD_LOCKRASTER;
mr.lockRasterIds = [32,454,14];
...
});
The mosaic method determines how the selected rasters are ordered. View the esri.layers.MosaicRule constants for valid values.
Sample:
require([
"esri/layers/MosaicRule", ...
], function(MosaicRule, ... ) {
var mr = new MosaicRule();
mr.method = MosaicRule.METHOD_LOCKRASTER;
...
});
A multiple dimensional service can have multiple variables and multiple dimensions. Multiple dimensional definitions are usually used to filter data. (Added at v3.11)
Sample:
var mr = new MosaicRule();
mr.multidimensionalDefinition = [];
mr.multidimensionalDefinition.push(new DimensionalDefinition({
variableName: "Salinity",
dimensionName: "StdTime",
values: [1259625600000]
}));
Defines a selection using a set of ObjectIds. This property applies to all mosaic methods.
Defines the mosaic operation used to resolve overlapping pixels. See the constants for a list of valid values.
The name of the attribute field that is used together with a constant sortValue to define the mosaicking order when the mosaic method is set to METHOD_ATTRIBUTE. The ordering is defined by the absolute value of the difference between the specified sort field value and the sort base value. For example, if the sort field is Month and the sort value is 7 (July), then the ordering is defined by ABS(Month -7).
A constant value defining a reference or base value for the sort field when the mosaic method is set to METHOD_ATTRIBUTE.
Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters.
Sample:
require([
"esri/layers/MosaicRule", ...
], function(MosaicRule, ... ) {
var mr = new MosaicRule();
mr.method = MosaicRule.METHOD_VIEWPOINT;
mr.viewpoint = inPoint;
layer.setMosaicRule(mr);
...
});
The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods.
Method Details
Returns an easily serializable object representation of the mosaic rule.