- URL:
- https://<imageservice-url>/colormap
- Methods:
GET
- Required Capability:
- Image
- Version Introduced:
- 10.1
Description
The colormap
resource returns RGB color representation of pixel values. This resource is supported if the has
property of the service is true
and the colormap
property is false
.
Support for the rendering
parameter was added at 10.6. This is used to retrieve a color map defined through the server-side raster function template associated with image services. Image services always support this operation regardless of the has
property setting of the service, but it requires the colormap
property to be false
.
Request parameters
Parameter | Details |
---|---|
(Optional) | Specifies the rendering rule for how the requested image should be rendered. Refer to the raster function JSON objects for examples and syntax. |
| This parameter was added at 10.8.1 and it is available if the image service uses This parameter can be used to request a colormap for each variable for an image service that has multidimensional information. It will return a colormap for the whole image service if not specified. Eligible variable names can be queried from the Multidimensional Info image service resource. |
|
The response format. The default response format is Values: |
Example usage
Below is a sample request URL that demonstrates how this request can be used to return the colormap of an image service:
https://machine.domain.com/webadaptor/rest/services/LandCover/ImageServer/colormap?f=json
Below is a sample request URL that demonstrates how to return the color map defined in a raster function template of an image service:
https://machine.domain.com/webadaptor/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
]
]
}