require(["esri/layers/support/MosaicRule"], function(MosaicRule) { /* code goes here */ });
Class: esri/layers/support/MosaicRule
Inheritance: MosaicRule Accessor
Since: ArcGIS API for JavaScript 4.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.
See also:
Example:
new MosaicRule({
  ascending: true,
  method: "center",
  operation: "last"
});

Constructors

new MosaicRule(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
NameTypeSummaryClass
Boolean

Indicates whether the sort should be ascending.

more details
more detailsMosaicRule
String

The name of the class.

more details
more detailsAccessor
Number[]

An array of raster Ids.

more details
more detailsMosaicRule
String

The mosaic method determines how the selected rasters are ordered.

more details
more detailsMosaicRule
DimensionalDefinition[]

A multiple dimensional service can have multiple dimensions for one or more variables.

more details
more detailsMosaicRule
Number[]

Defines a selection using a set of ObjectIDs.

more details
more detailsMosaicRule
String

Defines the mosaic operation used to resolve overlapping pixels.

more details
more detailsMosaicRule
String

The name of the attribute field that is used with a constant sortValue to define the mosaicking order when the mosaic method is set to attribute.

more details
more detailsMosaicRule
String

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

more details
more detailsMosaicRule
Point

Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters.

more details
more detailsMosaicRule
String

The where clause determines which rasters will participate in the mosaic.

more details
more detailsMosaicRule

Property Details

ascendingBoolean

Indicates whether the sort should be ascending. This property applies to all mosaic methods where an ordering is defined except seamline.

Default Value:true
declaredClassStringreadonly inherited
Since: ArcGIS API for JavaScript 4.7

The name of the class. The declared class name is formatted as esri.folder.className.

lockRasterIdsNumber[]

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.

Example:
var mr = new MosaicRule();
mr.method = "lock-raster";
mr.lockRasterIds = [32,454,14];
methodString

The mosaic method determines how the selected rasters are ordered.

Possible Values: none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline

Example:
var mr = new MosaicRule();
mr.method = "lock-raster";
multidimensionalDefinitionDimensionalDefinition[]

A multiple dimensional service can have multiple dimensions for one or more variables. Use multiDimensionalDefinitions to filter data based on a slice or range of data. For example, a single ImageryLayer may have a depth dimension storing sea temperatures for the same pixel location at various depths. Another dimension could be time, where the same pixel stores multiple values based on a window of time.

This property can be used to filter and display ImageryLayer pixels for specific "slices" in those dimensions (e.g. display sea temperature at 1000m below sea level for a specific week in the year).

Example:
// Display water salinity at a specific point in time.
// In this case - Nov 30 2009
var mr = new MosaicRule();
mr.multidimensionalDefinition = [];
mr.multidimensionalDefinition.push(new DimensionalDefinition({
  variableName: "Salinity",
  dimensionName: "StdTime",
  values: [1259625600000]
}));

layer.mosaicRule = mr;
objectIdsNumber[]

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

operationString

Defines the mosaic operation used to resolve overlapping pixels.

Possible Values: first | last | min | max | mean | blend

sortFieldString

The name of the attribute field that is used with a constant sortValue to define the mosaicking order when the mosaic method is set to 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).

sortValueString

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

viewpointPoint

Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters.

Example:
var mr = new MosaicRule();
mr.method = "viewpoint";
mr.viewpoint = inPoint;
layer.mosaicRule = mr;
whereString

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

Method Overview

NameReturn TypeSummaryClass
MosaicRule

Creates a clone of the MosaicRule object.

more details
more detailsclone
*

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform.

more details
more detailsMosaicRule
Object

Converts an instance of this class to its ArcGIS portal JSON representation.

more details
more detailsMosaicRule

Method Details

clone(){MosaicRule}inner

Creates a clone of the MosaicRule object.

Returns:
TypeDescription
MosaicRuleA clone of the object that invoked this method.
Example:
// Creates a clone of the mosaic rule
var mr = layer.mosaicRule.clone();
fromJSON(json){*}static

Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input json parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.

Parameter:
json Object

A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.

Returns:
TypeDescription
*Returns a new instance of this class.
toJSON(){Object}

Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() topic in the Guide for more information.

Returns:
TypeDescription
ObjectThe ArcGIS portal JSON representation of an instance of this class.

API Reference search results

NameTypeModule
Loading...