Skip to content
import RasterInfo from "@arcgis/core/layers/support/RasterInfo.js";
Inheritance:
RasterInfoAccessor
Since
ArcGIS Maps SDK for JavaScript 4.12

Describes general raster data information exposed by the ArcGIS REST API for ImageryLayer, ImageryTileLayer and WCSLayer. RasterInfo contains information such band count, statistics, data type, dimensions and key properties.

See also

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.

attributeTable

Property
Type
FeatureSet | null | undefined

The raster attribute table associated with an imagery layer. It returns categorical mapping of pixel values such as class, group, or category, or membership.

See also
Example
layer.when(function() {
// accesses the raster attribute table of the layer
let rasterAttributes = layer.serviceRasterInfo.attributeTable.features;
});

bandCount

Property
Type
number

Raster band count.

bandInfos

readonly Property
Type
RasterBandInfo[]
Since
ArcGIS Maps SDK for JavaScript 4.27

This property provides additional information for each band in the raster. Raster products will include information such as the color name, wavelength range, the radiance gain, radiance bias, and solar irradiance. All other raster datasets will only contain the band index value.

colormap

Property
Type
number[][] | null | undefined

Raster colormap that can be used to display the imagery layer. Each element in the array defines the pixel value and the red, green, and blue color values.

See also

dataType

readonly Property
Type
RasterDataType

Raster data type controls how the data is rendered by default.

ValueDescription
genericUses the application defaults for resampling and stretching.
elevationApplies bilinear resampling and a Min-Max stretch.
thematicApplies nearest neighbor resampling and a Standard Deviation stretch.
processedNo stretch is applied.
scientificUses the blue to red color ramp to display the data.
vector-uvUses the U (magnitude component) and V(direction component) components in the vector field renderer.
vector-magdirUses the magnitude and direction in the vector field renderer.
standard-timeUses the blue to red color ramp to display the data --- pixel value represents time encoded using OLEDate.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

extent

autocast Property
Type
Extent

The minimum and maximum X and Y coordinates of a bounding box containing all the raster data.

hasMultidimensionalTranspose

readonly Property
Type
boolean
Since
ArcGIS Maps SDK for JavaScript 4.25

Indicates whether the source multidimensional data has been transposed. This only applies to ImageryTileLayer that references multidimensional image service.

height

Property
Type
number
Since
ArcGIS Maps SDK for JavaScript 4.15

Raster height (row count) in pixels.

histograms

Property
Type
RasterHistogram[] | null | undefined

Raster histograms return basic name-value pairs for number of bins, min and max bounding values, counts of pixels in each bin.

See also

keyProperties

Property
Type
Record<string, any>

Raster key properties.

See also

multidimensionalInfo

Property
Type
RasterMultidimensionalInfo | null | undefined

Returns the multidimensional information associated with the raster service referenced in an imagery layer. If defined, it contains an information on variables and dimensions associated with the service. Multidimensional data is stored as variables where each variable is a multidimensional array represents data captured in multiple dimensions like times and depths/heights.

You can filter the multidimensional data with one or multiple dimensional slices by setting the MosaicRule.multidimensionalDefinition property on an ImageryLayer.mosaicRule or by setting the multidimensionalDefinition property on an ImageryTileLayer.multidimensionalDefinition or a WCSLayer.multidimensionalDefinition.

See also
Example
// update the statistics of the layer's stretch renderer.
const renderer = layer.renderer.clone();
const dimensions = layer.rasterInfo.multidimensionalInfo;
// get the salinity variable's statistics
const salinity = dimensions.variables.find((variable) => variable.name === variableName);
renderer.customStatistics = salinity.statistics;
layer.renderer = renderer;

noDataValue

Property
Type
number | Array<number | null | undefined> | null | undefined
Since
ArcGIS Maps SDK for JavaScript 4.15

The pixel value representing no available information. Can be a number (same value for all bands) or array (specific value for each band).

pixelSize

Property
Type
PixelSize

Raster pixel size. Specifies the pixel size being identified on the x and y axis. Defaults to the base resolution of the dataset when not specified.

pixelType

Property
Type
RasterPixelType

Pixel type for the raster data source.

ValueRange of values that each cell can contain
unknownPixel type is unknown
s8-128 to 127
s16-32768 to 32767
s32-2147483648 to 2147483647
u80 to 255
u160 to 65535
u320 to 4294967295
f32-3.402823466e+38 to 3.402823466e+38
f640 to 18446744073709551616

sensorInfo

readonly Property
Type
RasterSensorInfo | null | undefined
Since
ArcGIS Maps SDK for JavaScript 4.27

The sensor information associated with an image service referenced by a layer.

spatialReference

autocast Property
Type
SpatialReference

The spatial reference of the raster.

statistics

Property
Type
RasterBandStatistics[] | null | undefined

Raster band statistics. These include the minimum value in the raster, maximum value, mean of all values, and standard deviation.

width

Property
Type
number
Since
ArcGIS Maps SDK for JavaScript 4.15

Raster width (column count) in pixels.

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.