Raster Attribute Table

URL:
https://<imageservice-url>/rasterAttributeTable
Methods:
GET
Required Capability:
Image
Version Introduced:
10.1

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

ParameterDetails

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
"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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
{
 "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"
   }
  }
 ]
}

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