Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: MosaicRule

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

NameSummary
new MosaicRule()Creates a new MosaicRule object.
new MosaicRule(json)Create a new mosaic rule object using a json string representing a serialized version of the mosaic rule.

Constants

NameDescription
METHOD_ATTRIBUTESorts rasters based on an attribute field and its difference from a base value. All mosaic operations apply (see operation constants).
METHOD_CENTERSorts 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_LOCKRASTERSpecifies that only rasters in the given list of raster Ids participate in the mosaic. All mosaic operations apply (see operation constants).
METHOD_NADIRSorts 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_NONENo mosaic method specified.
METHOD_NORTHWESTSorts 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_SEAMLINECuts 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_VIEWPOINTSorts rasters based on a user-defined viewpoint location and nadir location. All mosaic operations apply (see operation constants).
OPERATION_BLENDTakes the blended value of all overlapping pixels.
OPERATION_FIRSTTakes the first value of all overlapping pixels.
OPERATION_LASTTakes the last value of all overlapping pixels.
OPERATION_MAXTakes the maximum value of all overlapping pixels.
OPERATION_MEANTakes the mean value of all overlapping pixels.
OPERATION_MINTakes the minimum value of all overlapping pixels.
OPERATION_SUMTakes the sum of all overlapping pixels.

Properties

NameTypeSummary
ascendingBooleanIndicates whether the sort should be ascending or not.
lockRasterIdsNumber[]An array of raster Ids.
methodStringThe mosaic method determines how the selected rasters are ordered.
multidimensionalDefinitionDimensionalDefinition[]A multiple dimensional service can have multiple variables and multiple dimensions.
objectIdsNumber[]Defines a selection using a set of ObjectIds.
operationStringDefines the mosaic operation used to resolve overlapping pixels.
sortFieldStringThe 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.
sortValueStringA constant value defining a reference or base value for the sort field when the mosaic method is set to METHOD_ATTRIBUTE.
viewpointPointDefines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters.
whereStringThe where clause determines which rasters will participate in the mosaic.

Methods

NameReturn typeSummary
toJson()ObjectReturns an easily serializable object representation of the mosaic rule.
Constructor Details

new MosaicRule()

Creates a new MosaicRule object
Sample:
require([
  "esri/layers/MosaicRule", ... 
], function(MosaicRule, ... ) {
  var mr = new MosaicRule();
  ...
});

new MosaicRule(json)

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

<Boolean> ascending

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

<Number[]> lockRasterIds

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]; 
  ...
});

<String> method

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;
  ...
});

<DimensionalDefinition[]> multidimensionalDefinition

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]
}));

<Number[]> objectIds

Defines a selection using a set of ObjectIds. This property applies to all mosaic methods.

<String> operation

Defines the mosaic operation used to resolve overlapping pixels. See the constants for a list of valid values.

<String> sortField

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).

<String> sortValue

A constant value defining a reference or base value for the sort field when the mosaic method is set to METHOD_ATTRIBUTE.

<Point> viewpoint

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);
  ...
});

<String> where

The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods.
Method Details

toJson()

Returns an easily serializable object representation of the mosaic rule.
Return type: Object