Tabulate Area

URL:
https://<root>/<serviceName>/RasterAnalysisTools/GPServer/TabulateArea
Methods:
GET
Version Introduced:
11.3

Description

The TabulateArea task calculates cross-tabulated areas between two datasets and outputs a table.

Request parameters

ParameterDetails

inputZoneRasterOrFeatures (Required)

The layer that defines the boundaries of the zones.

Syntax: This parameter can have either a raster input or a feature input. For raster input, this parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset. For feature input, this parameter can be specified as either a URL to a feature service layer or a feature collection.

Raster input examples:

Use dark colors for code blocksCopy
1
2
3
4
//Portal item as input raster
"inputZoneRasterOrFeatures":{"itemId": <portal item Id>}
//URL as input raster
"inputZoneRasterOrFeatures":{"url": <image service layer url>}

Feature input examples:

Use dark colors for code blocksCopy
1
2
3
4
//Feature layer URL
"inputZoneRasterOrFeatures":{"url": <feature service layer url>}
//Feature collection
"inputZoneRasterOrFeatures":{"layerDefinition": {}, "featureSet": {}}

zoneField (Required)

A field on the inputZoneRasterOrFeatures value that contains the values that define each zone.

It can be an integer or a string field of the zone dataset.

Example:

Use dark colors for code blocksCopy
1
"zoneField": ParcelID

inputClassRasterOrFeatures (Required)

The layer that defines the classes that will have their area summarized within each zone.

Syntax: This parameter can have either a raster input or a feature input. For raster input, this parameter can be specified as a portal item ID, a URL to a raster image service layer, a cloud raster dataset, or a shared raster dataset. For feature input, this parameter can be specified as either a URL to a feature service layer or a feature collection.

Raster input examples:

Use dark colors for code blocksCopy
1
2
3
4
//Portal item as input raster
"inputClassRasterOrFeatures":{"itemId": <portal item Id>}
//URL as input raster
"inputClassRasterOrFeatures":{"url": <image service layer url>}

Feature input examples:

Use dark colors for code blocksCopy
1
2
3
4
//Feature layer URL
"inputClassRasterOrFeatures":{"url": <feature service layer url>}
//Feature collection
"inputClassRasterOrFeatures":{"layerDefinition": {}, "featureSet": {}}

classField (Required)

A field on the inputClassRasterOrFeatures value that contains the values that define each class.

It can be an integer or a string field of the class dataset.

Example:

Use dark colors for code blocksCopy
1
"classField": Landuse_Class

outputTableName (Required)

The output table feature service name that will be created.

You can specify the name, or you can create an empty service using Portal Admin Sharing API and use the return JSON object as input to this parameter.

Syntax: A JSON object describes the name of the output or the output table.

Output name example:

Use dark colors for code blocksCopy
1
"outputTableName":{"serviceProperties":{"name":"testrasteranalysis"}}

Output table examples:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
//Output portal item:
"outputTableName":{"itemId": <portal item id>}
//Output url:
"outputTableName":{"url": <feature service url>}
//Output table layer service:
"outputTableName":{"serviceProperties":
  {"name":"testrasteranalysis",
    "serviceUrl":"https://<server name>/server/rest/services/Hosted/testrasteranalysis/FeatureServer/0"},
  "itemProperties":{"itemId":"351fe8441a1a436d8001124487b02550","folderId":"sdfwerfbd3ec25584d0d8f4"}
}

analysisCellSize (Optional)

The cell size of the output raster that will be created.

Example:

Use dark colors for code blocksCopy
1
"analysisCellSize": 30

classesAsRows (Optional)

Specifies how the values from the inputClassRasterOrFeatures will be represented in the output table.

Syntax: A Boolean value as either true or false.

  • true—The classes will be represented as rows.
  • false—The classes will be represented as fields. This is the default.

Example:

Use dark colors for code blocksCopy
1
"classesAsRows": true

context (Optional)

Contains additional settings that affect task processing. This task has the following settings:

  • Extent (extent )—A bounding box that defines the analysis area.

  • Output Spatial Reference (outSR )—The output raster will be projected into the output spatial reference.

  • Snap Raster (snapRaster )—The output raster will have its cells aligned with the specified snap raster.

  • Cell Size (cellSize )—The output raster will have the resolution specified by cell size.

  • Mask (mask)—Only cells that fall within the analysis mask will be considered in the operation.

f

The response format. The default response format is html .

Values: html | json | pjson

Response

When you submit a request, the task assigns a unique job ID for the transaction.

Use dark colors for code blocksCopy
1
2
3
4
{
  "jobId": "<unique job identifier>",
  "jobStatus": "<job status>"
}

After the initial request is submitted, you can use the jobId to periodically check the status of the job and messages as described in Checking job status. Once the job has successfully completed, you use the jobId to retrieve the results. To track the status, you can make a request of the following form:

Use dark colors for code blocksCopy
1
https://<raster analysis tools url>/TabulateArea/jobs/<jobId>

When the status of the job request is esriJobSucceeded , you can access the results of the analysis by making a request of the following form:

Use dark colors for code blocksCopy
1
https://<raster analysis tools url>/TabulateArea/jobs/<jobId>/results/outputTable

Example usage

The following is a sample request URL for ZonalGeometryAsTable:

Use dark colors for code blocksCopy
1
https://services.myserver.com/arcgis/rest/services/System/RasterAnalysisTools/GPServer/ZonalGeometryAsTable/submitJob

JSON Response syntax

The response returns the outputTable output parameter, which has properties for parameter name, data type, and value. The content of value is always the output table itemId and the feature service URL.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "paramName": <parameter name>,
  "dataType": "GPString",
  "value": {
    "itemId": <item Id>,
    "url": <URL>
  }
}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "paramName": "outputTable",
  "dataType": "GPString",
  "value": {
    "url": "https://<server name>/server/rest/services/Hosted/<service name>/FeatureServer/0",
    "itemId": "351fe8441a1a436d8001124487b02550"
  }
}

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