Colormap
- URL:http://<imageservice-url>/colormap
- Required Capability:Image
- Version Introduced:10.1
Description
This resource is supported at 10.1 and later.
The colormap resource returns RGB color representation of pixel values. This resource is supported if the hasColormap property of the service is true and the colormapToRGB property is false.
Support for the renderingRule parameter was added at 10.6. This is used to retrieve a colormap defined through the server-side raster function template associated with image services. Image services always support this operation regardless of the hasColormap property setting of the service, but it requires the colormapToRGB property to be false.
.
Request parameters
Parameter |
Details |
---|---|
f |
Description: The response format. The default response format is html. Values: html | json |
renderingRule (optional) | Description: Specifies the rendering rule for how the requested image should be rendered. Refer to the raster function json objects for examples and syntax. |
Example usage
Example: Return the colormap of an image service.
http://myserver:6080/arcgis/rest/services/LandCover/ImageServer/colormap?f=json
Example: Return the colormap defined in a raster function template of an image service.
http://myserver:6080/arcgis/rest/services/LandCover/ImageServer/colormap?f=json&renderingrule={"rasterFunction":"myRFTthatHasColormapFunctionAtTheEnd"}
JSON response syntax
{"Colormap" : [
[<value1>, <red1>, <green1>, <blue1>], //[int, int, int, int]
[<value2>, <red2>, <green2>, <blue2>]
]
}
JSON response example
{
"colormap": [
[
11,
102,
140,
190
],
[
12,
255,
255,
255
]
}