import ImageHistogramParameters from "@arcgis/core/rest/support/ImageHistogramParameters.js";const ImageHistogramParameters = await $arcgis.import("@arcgis/core/rest/support/ImageHistogramParameters.js");- Inheritance:
- ImageHistogramParameters→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.20
Input parameters for the ImageryLayer.computeHistograms() or ImageryLayer.computeStatisticsHistograms() method on ImageryLayer, or the ImageryTileLayer.computeStatisticsHistograms() method on ImageryTileLayer.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
| | ||
MosaicRule | null | undefined | | |
| | ||
| | ||
TimeExtent | null | undefined | |
mosaicRule
- Type
- MosaicRule | null | undefined
Specifies the mosaic rule on how individual images should be mosaicked when the histogram is computed. When a mosaic rule is not specified, the current settings on the ImageryLayer will be used.
pixelSize
- Type
- Point
Specifies the pixel size (or the resolution). If pixel size is not specified, pixelSize will default to the base resolution of the image service.
The raster at the specified pixel size in the mosaic dataset will be used for the histogram calculation.
Example
// set the pixel size parameter to match the current// resolution of the view and spatial referencelet pixelSize = { x:view.resolution, y:view.resolution, spatialReference: view.spatialReference}// set the histogram parameters to request// data for the current view extent and resolutionlet params = new ImageHistogramParameters({ geometry: view.extent, pixelSize: pixelSize});
// request for histograms for the specified parameterslayer.computeHistograms(params).then((results) =>{ // results are returned and process it as needed. console.log("histograms", result);}).catch(function(err){ console.log("err", err)}); rasterFunction
- Type
- RasterFunction | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 4.27
Specifies the raster function from which to compute the statistics and histogram. The rasterFunction defines how the image should be processed. When a rasterFunction is not specified, the current settings on the ImageryLayer will be used.
timeExtent
- Type
- TimeExtent | null | undefined
The time extent for which to compute the statistics and histogram. The time parameter is supported at ArcGIS Server 10.8 and later.
Methods
fromJSON
- Signature
-
fromJSON (json: any): any
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.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | 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
- any
Returns a new instance of this class.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.