FRAMES | NO FRAMES
Raster Functions

This is an archive of a previous version of the ArcGIS REST API. The current version can be found at http://resources.arcgis.com/en/help/arcgis-rest-api/

Overview

The image service's export image operation supports a renderingRule parameter. This parameter has the following JSON syntax:

{
  "rasterFunction" : "<rasterFunctionName>",
  "rasterFunctionArguments" : {<rasterFunctionArguments>},
  "variableName" : "<variableName>"
}

The structure of the rasterFunctionArguments object varies based on the rasterFunction name. This document lists the raster function names and the corresponding arguments supported by the REST API.

"rasterFunction" : "Aspect"

The Aspect raster function takes no arguments. Hence, specifying only the rasterFunction property suffices in this case.

{
  "rasterFunction" : "Aspect"
}

"rasterFunction" : "Colormap"

The arguments for the Colormap function are as shown below:

{
  "rasterFunction" : "Colormap",
  "rasterFunctionArguments" : {
    "ColormapName" : "<Random | NDVI | Elevation | Gray>",
    "Colormap" : [
      [<value1>, <red1>, <green1>, <blue1>], //[int, int, int, int]
      [<value2>, <red2>, <green2>, <blue2>]
    ]
  },
  "variableName" : "Raster"
}

Example 1:

{
  "rasterFunction" : "Colormap",
  "rasterFunctionArguments" : {
    "ColormapName" : "Random"
  },
  "variableName" : "Raster"
}

Example 2:

{
  "rasterFunction" : "Colormap",
  "rasterFunctionArguments" : {
    "Colormap" : [
      [0, 1, 2, 3],
      [2, 45, 52, 13]
    ]
  },
  "variableName" : "Raster"
}

"rasterFunction" : "Hillshade"

The arguments for the Hillshade function are as shown below:

{
  "rasterFunction" : "Hillshade",
  "rasterFunctionArguments" : {
    "Azimuth" : <Azimuth>, //double (e.g. 215.0)
    "Altitude" : <Altitude>, //double (e.g. 75.0)
    "ZFactor" : <ZFactor> //double (e.g. 0.3)
  },
  "variableName" : "DEM"
}

Example:

{
  "rasterFunction" : "Hillshade",
  "rasterFunctionArguments" : {
    "Azimuth" : 215.0,
    "Altitude" : 75.0,
    "ZFactor" : 0.3
  },
  "variableName" : "DEM"
}

"rasterFunction" : "NDVI"

The arguments for the NDVI function are as shown below:

{
  "rasterFunction" : "NDVI",
  "rasterFunctionArguments" : {
    "VisibleBandID" : <VisibleBandID>, //int (zero-based band id, e.g. 2)
    "InfraredBandID" : <InfraredBandID> //int (zero-based band id, e.g. 1)
  },
  "variableName" : "Raster"
}

Example:

{
  "rasterFunction" : "NDVI",
  "rasterFunctionArguments" : {
    "VisibleBandID" : 2,
    "InfraredBandID" : 1
  },
  "variableName" : "Raster"
}

"rasterFunction" : "ShadedRelief"

The arguments for the ShadedRelief function are as shown below:

{
  "rasterFunction" : "ShadedRelief",
  "rasterFunctionArguments" : {
    "Azimuth" : <Azimuth>, //double (e.g. 215.0)
    "Altitude" : <Altitude>, //double (e.g. 75.0)
    "ZFactor" : <ZFactor>, //double (e.g. 0.3)
    "Colormap" : [
      [<value1>, <red1>, <green1>, <blue1>], //[int, int, int, int]
      [<value2>, <red2>, <green2>, <blue2>]
    ]
  },
  "variableName" : "Raster"
}

Example:

{
  "rasterFunction" : "ShadedRelief",
  "rasterFunctionArguments" : {
    "Azimuth" : 215.0,
    "Altitude" : 75.0,
    "ZFactor" : 0.3,
    "Colormap" : [
      [0, 1, 2, 3],
      [2, 45, 52, 13]
    ]
  },
  "variableName" : "Raster"
}

"rasterFunction" : "Slope"

The arguments for the Slope function are as shown below:

{
  "rasterFunction" : "Slope",
  "rasterFunctionArguments" : {
    "ZFactor" : <ZFactor> //double (e.g. 0.3)
  },
  "variableName" : "DEM"
}

Example:

{
  "rasterFunction" : "Slope",
  "rasterFunctionArguments" : {
    "ZFactor" : 0.3
  },
  "variableName" : "DEM"
}

"rasterFunction" : "Statistics"

The arguments for the Statistics function are as shown below:

{
  "rasterFunction" : "Statistics",
  "rasterFunctionArguments" : {
    "Type" : "<Min | Max | Mean | StandardDeviation>",
    "KernelColumns" : <KernelColumns>, //int (e.g. 3)
    "KernelRows" : <KernelRows> //int (e.g. 3)
  },
  "variableName" : "Raster"
}

Example:

{
  "rasterFunction" : "Statistics",
  "rasterFunctionArguments" : {
    "Type" : "Mean",
    "KernelColumns" : 3,
    "KernelRows" : 3
  },
  "variableName" : "Raster"
}

"rasterFunction" : "Stretch"

The arguments for the Stretch function are as shown below:

{
  "rasterFunction" : "Stretch",
  "rasterFunctionArguments" : {
    "StretchType" : <StretchType>, //int (0 = None, 3 = StandardDeviation, 4 = Histogram Equalization, 5 = MinMax)
    "NumberOfStandardDeviations" : <NumberOfStandardDeviations>, //int (e.g. 2)
    "Statistics" : [
      [<min1>, <max1>, <mean1>, <standardDeviation1>], //[double, double, double, double]
      [<min2>, <max2>, <mean2>, <standardDeviation2>]
    ],
    "Gamma" : [<gamma1>, <gamma2>] //array of doubles
  },
  "variableName" : "Raster"
}

Example:

{
  "rasterFunction" : "Stretch",
  "rasterFunctionArguments" : {
    "StretchType" : 3,
    "NumberOfStandardDeviations" : 2,
    "Statistics" : [
      [0.2, 222.46, 99.35, 1.64],
      [5.56, 100.345, 45.4, 3.96],
      [0, 352.37, 172.284, 2]
    ],
    "Gamma" : [1.25, 2, 3.95]
  },
  "variableName" : "Raster"
}