require(["esri/layers/support/MosaicRule"], (MosaicRule) => { /* code goes here */ });
import MosaicRule from "@arcgis/core/layers/support/MosaicRule.js";
esri/layers/support/MosaicRule
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
new MosaicRule({
ascending: true,
method: "center",
operation: "last"
});
Constructors
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
Indicates whether the sort should be ascending. | MosaicRule | ||
The name of the class. | Accessor | ||
The raster function applied on items before mosaicking. | MosaicRule | ||
An array of raster Ids. | MosaicRule | ||
The mosaic method determines how the selected rasters are ordered. | MosaicRule | ||
The multidimensional definitions associated with the ImageryLayer. | MosaicRule | ||
Defines a selection using a set of ObjectIDs. | MosaicRule | ||
Defines the mosaic operation used to resolve overlapping pixels. | MosaicRule | ||
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 | MosaicRule | ||
A constant value defining a reference or base value for the sort field when the mosaic method is set to | MosaicRule | ||
Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters. | MosaicRule | ||
The where clause determines which rasters will participate in the mosaic. | MosaicRule |
Property Details
-
itemRasterFunction
itemRasterFunction RasterFunction
Since: ArcGIS Maps SDK for JavaScript 4.27MosaicRule since 4.0, itemRasterFunction added at 4.27. -
The raster function applied on items before mosaicking.
-
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.
- Default Value:null
Examplelet mosaicRule = new MosaicRule(); mosaicRule.method = "lock-raster"; mosaicRule.lockRasterIds = [32,454,14];
-
method
method String
-
The mosaic method determines how the selected rasters are ordered. The mosaic method defines how the mosaicked image is created from these input rasters.
Value Description none Orders rasters based on the order of objectIds in the mosaic dataset attribute table. center Enables rasters to be sorted based their ZOrder, then PixelSize, and then by a default order where rasters that have their centers closest to the view center are placed on top. nadir Enables rasters to be sorted by the ZOrder, then PixelSize, and then by the distance between the nadir position and view center. This is similar to the Closest to Center method but uses the nadir point to a raster, which may be different than the center, especially for oblique imagery. viewpoint Orders rasters based on the ZOrder, then PixelSize, and then by a user-defined location and nadir location for the rasters using the viewpoint. attribute Enables raster ordering based on ZOrder, then PixelSize, and then by a defined metadata attribute and its difference from a base value. lock-raster Enables a user to lock the display of single or multiple rasters based on the lockRasterIds. northwest Enables raster ordering by ZOrder, then PixelSize, and then by the shortest distance between the center of a raster to the northwest position. seamline Cuts the raster using the predefined seamline shape for each raster, using optional feathering along the seams, and orders images based on the ZOrder and then the SOrder fields in the attribute table. Possible Values:"none" |"center" |"nadir" |"viewpoint" |"attribute" |"lock-raster" |"northwest" |"seamline"
Examplelet mosaicRule = new MosaicRule(); mosaicRule.method = "lock-raster";
-
multidimensionalDefinition
multidimensionalDefinition DimensionalDefinition[]
-
The multidimensional definitions associated with the ImageryLayer. Filters the layer by slicing data along defined variables and dimensions such as time, depth, altitude, etc. For example, you can display a particular variable such as temperature or salinity measured at a fixed dimension (e.g. time, depth). These data types are commonly used in atmospheric, oceanographic, and earth sciences. For example, it can be used to display sea temperature at -1000m below sea level for a specific week in the year.
Multiple definitions are consolidated by server into one single where clause. The consolidation rule is:
- For the same variableName but different dimensionName, it uses the
AND
operator to connect all dimension conditions for the same variable. - For different variableName, it uses the
OR
operator to connect any variable that meets the dimension conditions.
Example// Display water salinity at a specific point in time. // In this case - Nov 30 2009 let mosaicRule = new MosaicRule(); mosaicRule.multidimensionalDefinition = []; mosaicRule.multidimensionalDefinition.push(new DimensionalDefinition({ variableName: "Salinity", dimensionName: "StdTime", values: [1259625600000] })); layer.mosaicRule = mosaicRule;
- For the same variableName but different dimensionName, it uses the
-
Defines a selection using a set of ObjectIDs. This property applies to all mosaic methods.
-
operation
operation String
-
Defines the mosaic operation used to resolve overlapping pixels.
Possible Values
Value Description first The overlapping areas will contain the cells from the first raster dataset listed in the source. last The overlapping areas will contain the cells from the last raster dataset listed in the source. min The overlapping areas will contain the minimum cell values from all the overlapping cells. max The overlapping areas will contain the maximum cell values from all the overlapping cells. mean The overlapping areas will contain the mean cell values from all the overlapping cells. blend The overlapping areas will be a blend of the cell values that overlap. This blend value relies on an algorithm that is weight based and dependent on the distance from the cells to the edge within the overlapping area. sum The overlapping areas will contain the total sum of the cell values from all the overlapping cells. Possible Values:"first" |"last" |"min" |"max" |"mean" |"blend" |"sum"
-
sortField
sortField 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
. 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 isMonth
and the sort value is7 (July)
, then the ordering is defined byABS(Month -7)
.- Default Value:null
-
A constant value defining a reference or base value for the sort field when the mosaic method is set to
attribute
.- Default Value:null
-
viewpoint
viewpoint Point
-
Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters.
Examplelet mosaicRule = new MosaicRule(); mosaicRule.method = "viewpoint"; mosaicRule.viewpoint = inPoint; layer.mosaicRule = mosaicRule;
-
where
where String
-
The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods. This property will be overridden by the ImageryLayer's definitionExpression property if both properties are set.
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
Creates a clone of the MosaicRule object. | MosaicRule | ||
* | Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. | MosaicRule | |
Returns true if a named group of handles exist. | Accessor | ||
Removes a group of handles owned by the object. | Accessor | ||
Converts an instance of this class to its ArcGIS portal JSON representation. | MosaicRule |
Method Details
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, addHandles added at 4.25. -
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
clone
clone(){MosaicRule}
-
Creates a clone of the MosaicRule object.
ReturnsType Description MosaicRule A clone of the object that invoked this method. Example// Creates a clone of the mosaic rule let mosaicRule = layer.mosaicRule.clone();
-
Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. 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.Parameterjson ObjectA 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.
ReturnsType Description * Returns a new instance of this class.
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}
Inherited from AccessorSince: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, hasHandles added at 4.25. -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, removeHandles added at 4.25. -
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
-
toJSON
toJSON(){Object}
-
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
ReturnsType Description Object The ArcGIS portal JSON representation of an instance of this class.