import RasterInfo from "@arcgis/core/layers/support/RasterInfo.js";const RasterInfo = await $arcgis.import("@arcgis/core/layers/support/RasterInfo.js");- 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.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
FeatureSet | null | undefined | | |
| | ||
bandInfos readonly | | |
| | ||
dataType readonly | | |
declaredClass readonly inherited | ||
| | ||
hasMultidimensionalTranspose readonly | | |
| | ||
RasterHistogram[] | null | undefined | | |
| | ||
| | ||
| | ||
| | ||
| | ||
sensorInfo readonly | | |
| | ||
| | ||
| |
attributeTable
- 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.
Example
layer.when(function() { // accesses the raster attribute table of the layer let rasterAttributes = layer.serviceRasterInfo.attributeTable.features;}); bandInfos
- 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.
dataType
- Type
- RasterDataType
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 Standard 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. |
hasMultidimensionalTranspose
- 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
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 4.15
Raster height (row count) in pixels.
histograms
- 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
multidimensionalInfo
- 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.
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 statisticsconst salinity = dimensions.variables.find((variable) => variable.name === variableName);renderer.customStatistics = salinity.statistics;layer.renderer = renderer; pixelSize
- 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
- Type
- RasterPixelType
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 |
sensorInfo
- Type
- RasterSensorInfo | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 4.27
The sensor information associated with an image service referenced by a layer.
statistics
- 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
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 4.15
Raster width (column count) in pixels.
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.