Skip to content
import ImageHistogramParameters from "@arcgis/core/rest/support/ImageHistogramParameters.js";
Inheritance:
ImageHistogramParametersAccessor

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

geometry

autocast Property
Type
Extent | Polygon | null | undefined

Input geometry that defines the area of interest for which the histograms and statistics will be computed. The geometry can be an Extent or a Polygon.

mosaicRule

autocast Property
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

autocast Property
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 reference
let pixelSize = {
x:view.resolution,
y:view.resolution,
spatialReference: view.spatialReference
}
// set the histogram parameters to request
// data for the current view extent and resolution
let params = new ImageHistogramParameters({
geometry: view.extent,
pixelSize: pixelSize
});
// request for histograms for the specified parameters
layer.computeHistograms(params).then((results) =>{
// results are returned and process it as needed.
console.log("histograms", result);
})
.catch(function(err){
console.log("err", err)
});

rasterFunction

autocast Property
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

autocast Property
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

MethodSignatureClass
fromJSON
inherited static
fromJSON(json: any): any
toJSON
inherited
toJSON(): any

fromJSON

inheritedstatic Method
Signature
fromJSON (json: any): any
Inherited from: JSONSupportMixin

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
ParameterTypeDescriptionRequired
json
any

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

inherited Method
Signature
toJSON (): any
Inherited from: JSONSupportMixin

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.