Colormap

Description

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 color map 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

renderingRule

(Optional)

Specifies the rendering rule for how the requested image should be rendered. Refer to the raster function JSON objects for examples and syntax.

variable

This parameter was added at 10.8.1 and it is available if the image service uses ArcObjects11 or ArcObjectsRasterRendering as the service provider.

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.

f

The response format. The default response format is html.

Values: html | json

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
    ]
  ]
}