Raster Attribute Table

Description

The rasterAttributeTable resource returns categorical mapping of pixel values (for example, a class, group, category, or membership). This resource is supported if the hasRasterAttributeTable property of the service is true.

For a 1-band image service that has a raster attribute table—if red, green, and blue colors are provided in the attribute table—these colors will be used in the exportImage operation by default. To turn off this color mapping, provide "rasterFunction":"None" for renderingRule in the exportImage request.

At 10.3 and later, this resource also takes an optional renderingRule parameter. If the service does not have a raster attribute table but a raster function template does, you can retrieve it through this parameter.

Request parameters

Parameter

Details

f

The response format. The default response format is html.

Values: html | json

renderingRule

This parameter was added at 10.3

Description: Specifies the rendering rule for how the requested image will be processed. The response is updated service information that reflects a custom processing as defined by the rendering rule. For example, if renderingRule contains an attributeTable function, the response will indicate "hasRasterAttributeTable": true; if the renderingRule contains functions that alter the number of bands, the response will indicate a correct bandCount value.

See the raster function JSON objects for the syntax and examples.

Example usage

Return attribute table for a land cover image service.

https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer/rasterAttributeTable?f=pjson

JSON Response syntax

{
"objectIdFieldName" : "<objectIdFieldName>",
"fields" : [
    {"name" : "<fieldName1>", "type" : "<fieldType1>", "alias" : "<fieldAlias1>", "length" : "<length1>"},
    {"name" : "<fieldName2>", "type" : "<fieldType2>", "alias" : "<fieldAlias2>", "length" : "<length2>"}
],
"features" : [ 
  <feature1>, <feature2>
]
}

JSON Response example

{
 "objectIdFieldName": "OBJECTID",
 "fields": [
  {
   "name": "OID",
   "type": "esriFieldTypeOID",
   "alias": "OID",
   "domain": null
  },
  {
   "name": "Value",
   "type": "esriFieldTypeInteger",
   "alias": "Value",
   "domain": null
  },
  {
   "name": "Count",
   "type": "esriFieldTypeDouble",
   "alias": "Count",
   "domain": null
  },
  {
   "name": "Red",
   "type": "esriFieldTypeSmallInteger",
   "alias": "Red",
   "domain": null
  },
  {
   "name": "Green",
   "type": "esriFieldTypeSmallInteger",
   "alias": "Green",
   "domain": null
  },
  {
   "name": "Blue",
   "type": "esriFieldTypeSmallInteger",
   "alias": "Blue",
   "domain": null
  },
  {
   "name": "ClassName",
   "type": "esriFieldTypeString",
   "alias": "ClassName",
   "domain": null,
   "length": 50
  }
 ],
 "features": [
  {
   "attributes": {
    "OID": 0,
    "Value": 11,
    "Count": 466650898,
    "Red": 71,
    "Green": 107,
    "Blue": 161,
    "ClassName": "Open Water"
   }
  },
  {
   "attributes": {
    "OID": 1,
    "Value": 12,
    "Count": 1731114,
    "Red": 209,
    "Green": 222,
    "Blue": 250,
    "ClassName": "Perennial Snow/Ice"
   }
  },
  {
   "attributes": {
    "OID": 2,
    "Value": 21,
    "Count": 287572411,
    "Red": 222,
    "Green": 202,
    "Blue": 202,
    "ClassName": "Developed, Open Space"
   }
  },
  {
   "attributes": {
    "OID": 3,
    "Value": 22,
    "Count": 124755469,
    "Red": 217,
    "Green": 148,
    "Blue": 130,
    "ClassName": "Developed, Low Intensity"
   }
  },
  {
   "attributes": {
    "OID": 4,
    "Value": 23,
    "Count": 48230587,
    "Red": 238,
    "Green": 0,
    "Blue": 0,
    "ClassName": "Developed, Medium Intensity"
   }
  },
  {
   "attributes": {
    "OID": 5,
    "Value": 24,
    "Count": 16773628,
    "Red": 171,
    "Green": 0,
    "Blue": 0,
    "ClassName": "Developed, High Intensity"
   }
  },
  {
   "attributes": {
    "OID": 6,
    "Value": 31,
    "Count": 106587346,
    "Red": 179,
    "Green": 174,
    "Blue": 163,
    "ClassName": "Barren Land"
   }
  },
  {
   "attributes": {
    "OID": 7,
    "Value": 41,
    "Count": 992056320,
    "Red": 104,
    "Green": 171,
    "Blue": 99,
    "ClassName": "Deciduous Forest"
   }
  },
  {
   "attributes": {
    "OID": 8,
    "Value": 42,
    "Count": 1087386133,
    "Red": 28,
    "Green": 99,
    "Blue": 48,
    "ClassName": "Evergreen Forest"
   }
  },
  {
   "attributes": {
    "OID": 9,
    "Value": 43,
    "Count": 189936312,
    "Red": 181,
    "Green": 202,
    "Blue": 143,
    "ClassName": "Mixed Forest"
   }
  },
  {
   "attributes": {
    "OID": 10,
    "Value": 52,
    "Count": 1906471766,
    "Red": 204,
    "Green": 186,
    "Blue": 125,
    "ClassName": "Shrub/Scrub"
   }
  },
  {
   "attributes": {
    "OID": 11,
    "Value": 71,
    "Count": 1285120838,
    "Red": 227,
    "Green": 227,
    "Blue": 194,
    "ClassName": "Herbaceous"
   }
  },
  {
   "attributes": {
    "OID": 12,
    "Value": 81,
    "Count": 610323595,
    "Red": 220,
    "Green": 217,
    "Blue": 61,
    "ClassName": "Hay/Pasture"
   }
  },
  {
   "attributes": {
    "OID": 13,
    "Value": 82,
    "Count": 1394827778,
    "Red": 171,
    "Green": 112,
    "Blue": 40,
    "ClassName": "Cultivated Crops"
   }
  },
  {
   "attributes": {
    "OID": 14,
    "Value": 90,
    "Count": 348297894,
    "Red": 186,
    "Green": 217,
    "Blue": 235,
    "ClassName": "Woody Wetlands"
   }
  },
  {
   "attributes": {
    "OID": 15,
    "Value": 95,
    "Count": 111141959,
    "Red": 112,
    "Green": 163,
    "Blue": 186,
    "ClassName": "Emergent Herbaceous Wetlands"
   }
  }
 ]
}