Colormap

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

ParameterDetails

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:

Use dark colors for code blocksCopy
1
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:

Use dark colors for code blocksCopy
1
https://machine.domain.com/webadaptor/rest/services/LandCover/ImageServer/colormap?f=json&renderingrule={"rasterFunction":"myRFTthatHasColormapFunctionAtTheEnd"}

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
{
  "Colormap": [
    [<value1>, <red1>, <green1>, <blue1>], //[int, int, int, int]
    [<value2>, <red2>, <green2>, <blue2>]
  ]
}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "colormap": [
    [
      11,
      102,
      140,
      190
    ],
    [
      12,
      255,
      255,
      255
    ]
  ]
}

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