Skip to content
URL:
https://<rasteranalysistools-url>/GenerateRasterCollection
Methods:
GETPOST
Version Introduced:
10.4

Description

The GenerateRasterCollection operation performs batch raster analysis on raster item or items stores in image services. The input image services of this service task must be image service published from mosaic dataset and should be hosted in the same Enterprise GIS.

Request parameters

ParameterDetails

outputCollectionName

(Required)

Specifies the output hosted image service. If the hosted image service already exists, use either the itemId or url of the service. Otherwise, specify a name for the hosted image service that will be created as a part of this operation.

Only one of the three formats above is needed as input. If multiple inputs are given in a single JSON, the itemId will be used first, then url, then serviceProperties.

Example:

Use dark colors for code blocksCopy
1
2
3
4
5
{"itemId": "<portal item id>"}

{"url": "<image service url>"}

{"serviceProperties": {"name": "<name of your choice>"}}

collectionBuilder

(Required)

The collection builder is used by the tool to define the input image collection. It is a template that contains arguments including the source mosaic dataset path, filters that extract a subset from the input data source, and many more.

Currently, this tool only supports SIMPLE_COLLECTION, which allows you to define a single data source and a query filter, for the data source.

collectionBuilderArguments

(Required)

The arguments defined by the collection builder.

  • DataSource: Image service url
  • WhereClause (Optional): An SQL expression to select the image items in the data source that you want to process.

Example:

Use dark colors for code blocksCopy
1
2
{"DataSource": {"url":"https://rdvmdb02.esri.com/server/rest/services/Landsat_MSPAN/ImageServer"},
"WhereClause": "Tag = `MS`"}

rasterFunction

(Optional)

JSON string of the raster function template. This raster function template will be used to process every image item in the input collection, or every group of image items if the raster function template was set to use “Item Group” mode. If no raster function template given, the tool will copy the image item from the input image collection based on the collect builder arguments to the output image service.

rasterFunctionArguments

(Optional)

The JSON string to specify the raster function arguments’ value. This parameter is optional, as the arguments value can also be defined in the function template.

For example, if the input image service contains two types of imagery as "MS" (multi-spectral) and "Pan" (Panchromatic), the function template is using "Item Group" mode to pansharpen "MS" and "Pan" images together to get a pan-sharpened image. The raster variable names defined in the function template should be "MS" and "Pan", respectively.

Example for Remap function arguments:

Use dark colors for code blocksCopy
1
{"InputRanges": [0,100,101,200], "OutputValues": [5,125]}

collectionProperties

(Optional)

Sets the output image service's key metadata properties.

Example:

Use dark colors for code blocksCopy
1
{"SensorName": "Landsat 8", "CloudCover": 20}

generateRasters

(Optional)

A Boolean flag that determines whether to batch generate the persisted cloud raster format (CRF) images in the raster store. The default value is false. If there is no file share raster store defined for the raster analysis image server, the tool will fail.

Values: true | false

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following is a sample request URL for the GenerateRasterCollection operation:

Use dark colors for code blocksCopy
1
https://organization.example.com/<context>/rest/services/System/RasterAnalysisTools/GPServer/GenerateRasterCollection/submitJob?outputCollectionName={"serviceProperties": {"name": "<name of your choice>"}}&collectionBuilder=SIMPLE_COLLECTION&collectionBuilderArguments={"DataSource":{"url":"https://rdvmdb02.esri.com/server/rest/services/Landsat_MSPAN/ImageServer"},"WhereClause":"Tag = `MS`"}&generateRasters=true&f=pjson

JSON Response example

The response returns the outputCollection output parameter, which has properties for parameter name, data type, and value. The content of the value is always the output raster dataset’s itemId and image service URL.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
 "paramName": "outputCollection",
 "dataType": "GPString",
 "value": {
  "itemId": "f121390b85ef419790479fc75b493efd",
  "url": " https://<server name>/arcgis/rest/services/Hosted/<service name>/ImageServer"
 }
}

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
https://<raster analysis tools url>/GenerateRasterCollection/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>/GenerateRasterCollection/jobs/<jobId>/results/outputCollection

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