Summarize Categorical Raster

URL:
https://<rasteranalysistools-url>/SummarizeCategoricalRaster
Methods:
GET
Version Introduced:
10.9.1

Description

Summarize Categorical Raster

The Summarize Categorical Raster tool generates a table containing the pixel count for each class, in each slice of an input categorical raster.

Request parameters

ParameterDetails

inputCategoricalRaster

(Required)

The input categorical raster. The input raster can be the Portal Item ID, Image Service URL, cloud raster dataset or shared raster dataset. This raster can also be multidimensional.

The input raster dataset must have a raster attribute table.

At least one type of input needs to be provided in the JSON object. If multiple inputs are given, the itemIds takes the priority.

Syntax: A JSON object describing the input raster(s).

Example for a single item.

Use dark colors for code blocksCopy
1
2
3
{"itemId": <portal item id>}
{"url": <image service url>}
{"uri": <cloud raster uri or shared data path>}

outputSummaryTableName

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

Example

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

dimension

(Optional)

The dimension parameter is used to define dimension for datasets that do not have multidimensional information. If the input is a multidimensional raster with more than one dimension, the class summary for all scales of both dimensions is calculated.

Syntax: A String that describes the dimension.

Example:

"StdTime"

areaOfInterest

(Optional)

The polygon feature layer containing the area or areas of interest to use when calculating the pixel count per category. If no area of interest is specified, the entire raster dataset will be included in the analysis. The input can be specified as a URL to a feature service layer or shared data path.

Syntax: A JSON object that describes the input.

Example

Use dark colors for code blocksCopy
1
2
3
{"itemId": <portal item id>}
{"url": <image service url or feature service url>}
{"uri": <cloud raster uri or shared data path>}

areaOfInterestIdField

(Optional)

The field in the polygon feature layer that defines each area of interest. Text and integer fields are supported.

Syntax: String representing the areaOfInterestField

Example:

"STATE_ABBR"

context

(Optional)

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

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

  • Parallel Processing Factor (parallelProcessingFactor )—The specified number or percentage of processes will be used for the analysis.

Example

Use dark colors for code blocksCopy
1
context={"parallelProcessingFactor": "4"}

f

The response format. The default response format is html.

Values: html | json

Response

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

Syntax:

Use dark colors for code blocksCopy
1
{ "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 Check job status. Once the job has successfully completed, 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
http://<analysis url>/SummarizeCategoricalRaster/jobs/<jobId>

Accessing results

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

Use dark colors for code blocksCopy
1
2
3
http://<raster analysis url>/
SummarizeCategoricalRaster/jobs/<jobId>/results/outputSummaryTable
?token=<your token>&f=json

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