RasterInfo

AMD: require(["esri/layers/support/RasterInfo"], (RasterInfo) => { /* code goes here */ });
ESM: import RasterInfo from "@arcgis/core/layers/support/RasterInfo.js";
Class: esri/layers/support/RasterInfo
Inheritance: RasterInfo Accessor
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

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
FeatureSet

The raster attribute table associated with an imagery layer.

RasterInfo
Number

Raster band count.

RasterInfo
RasterBandInfo[]

This property provides additional information for each band in the raster.

RasterInfo
Number[][]

Raster colormap that can be used to display the imagery layer.

RasterInfo
String

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

RasterInfo
String

The name of the class.

Accessor
Extent

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

RasterInfo
Boolean

Indicates whether the source multidimensional data has been transposed.

RasterInfo
Number

Raster height (row count) in pixels.

RasterInfo
Object[]

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

RasterInfo
Object

Raster key properties.

RasterInfo
RasterMultidimensionalInfo

Returns the multidimensional information associated with the raster service referenced in an imagery layer.

RasterInfo
Number|Number[]

The pixel value representing no available information.

RasterInfo
Object

Raster pixel size.

RasterInfo
String

Pixel type for the raster data source.

RasterInfo
RasterSensorInfo

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

RasterInfo
SpatialReference

The spatial reference of the raster.

RasterInfo
Object[]

Raster band statistics.

RasterInfo
Number

Raster width (column count) in pixels.

RasterInfo

Property Details

attributeTable

Property
attributeTable FeatureSet

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

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

bandCount

Property
bandCount Number

Raster band count.

bandInfos

Property
bandInfos RasterBandInfo[]
Since: ArcGIS Maps SDK for JavaScript 4.27 RasterInfo since 4.12, bandInfos added at 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
colormap Number[][]

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

Property
dataType String

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

Value Description
generic Uses the application defaults for resampling and stretching.
elevation Applies bilinear resampling and a Min-Max stretch.
thematic Applies nearest neighbor resampling and a Deviation stretch.
processed No stretch is applied.
scientific Uses the blue to red color ramp to display the data.
vector-uv Uses the U (magnitude component) and V(direction component) components in the vector field renderer.
vector-magdir Uses the magnitude and direction in the vector field renderer.
standard-time Uses the blue to red color ramp to display the data --- pixel value represents time encoded using OLEDate.

Possible Values:"generic"|"elevation"|"thematic"|"processed"|"scientific"|"vector-uv"|"vector-u"|"vector-v"|"vector-magdir"|"vector-magnitude"|"vector-direction"|"standard-time"

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

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

extent

Property
extent Extent

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

hasMultidimensionalTranspose

Property
hasMultidimensionalTranspose Boolean
Since: ArcGIS Maps SDK for JavaScript 4.25 RasterInfo since 4.12, hasMultidimensionalTranspose added at 4.25.

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

height

Property
height Number
Since: ArcGIS Maps SDK for JavaScript 4.15 RasterInfo since 4.12, height added at 4.15.

Raster height (row count) in pixels.

histograms

Property
histograms Object[]

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

keyProperties

Property
keyProperties Object

Raster key properties.

multidimensionalInfo

Property
multidimensionalInfo RasterMultidimensionalInfo

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 or by setting the multidimensionalDefinition property on an ImageryTileLayer or a WCSLayer.

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.statistics = salinity.statistics;
layer.renderer = renderer;

noDataValue

Property
noDataValue Number|Number[]
Since: ArcGIS Maps SDK for JavaScript 4.15 RasterInfo since 4.12, noDataValue added at 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
pixelSize Object

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.

Properties
x Number

Pixel size along the x axis.

y Number

Pixel size along the y axis.

pixelType

Property
pixelType String

Pixel type for the raster data source.

Value Range of values that each cell can contain
unknown Pixel type is unknown
s8 -128 to 127
s16 -32768 to 32767
s32 -2147483648 to 2147483647
u8 0 to 255
u16 0 to 65535
u32 0 to 4294967295
f32 -3.402823466e+38 to 3.402823466e+38
f64 0 to 18446744073709551616

Possible Values:"unknown"|"s8"|"s16"|"s32"|"u8"|"u16"|"u32"|"f32"|"f64"

sensorInfo

Property
sensorInfo RasterSensorInfo
Since: ArcGIS Maps SDK for JavaScript 4.27 RasterInfo since 4.12, sensorInfo added at 4.27.

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

spatialReference

Property
spatialReference SpatialReference

The spatial reference of the raster.

statistics

Property
statistics Object[]

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

Properties
min Number

The minimum pixel value.

max Number

The maximum pixel value.

stddev Number

The standard deviation of calculated pixel values.

avg Number

The average of calculated pixel values.

width

Property
width Number
Since: ArcGIS Maps SDK for JavaScript 4.15 RasterInfo since 4.12, width added at 4.15.

Raster width (column count) in pixels.

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor
*

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

RasterInfo
Boolean

Returns true if a named group of handles exist.

Accessor

Removes a group of handles owned by the object.

Accessor
Object

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

RasterInfo

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor 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();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key 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.

fromJSON

Method
fromJSON(json){*}static

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.

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
Type Description
* Returns a new instance of this class.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type 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");
}

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

toJSON

Method
toJSON(){Object}

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

Returns
Type Description
Object The ArcGIS portal JSON representation of an instance of this class.

Type Definitions

RasterMultidimensionalInfo

Type Definition
RasterMultidimensionalInfo Object

RasterMultidimensionalInfo contains dimensions for each variable in the service describing information about the images collected at multiple times, depths, or heights.

Properties
variables Object[]

The multi dimensional variables. It stores information such as name, unit and dimensions. For example, a temperature variable can store temperature data and the salinity variable can store the salinity data measured daily at different depths.

Specification
name String

Variable name.

description String
optional

Variable description.

unit String
optional

Unit of the variable measured in.

dimensions Object[]

A dimension may be used to represent real physical dimensions such as time or depth/height. It may also be used to represent more abstract quantities such as station id or station-time pair. For example, if your temperature data has a corresponding Date dimension field representing the day it was captured, and your salinity data has a Depth dimension field representing the depth at which it was measured, the Dimensions field for that variable would be Date and Depth.

Specification
name String

Dimension name.

description String
optional

Dimension description.

unit String
optional

Dimension unit.

optional

An array of single values or tuples [min, max] each defining a range of valid values along the specified dimension.

hasRegularIntervals Boolean
optional

Indicates if the dimension is recorded at regular intervals.

interval Number
optional

Dimension interval.

intervalUnit String
optional

Dimension interval unit.

extent Number[]
optional

The extent of dimension values.

optional

Variable statistics.

histograms RasterHistogram[]
optional

Variable histograms.

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.statistics = salinity.statistics;
layer.renderer = renderer;

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.