- URL:https://<rasteranalysistools-url>/Sample
- Version Introduced:10.8.1
Description
The Sample task creates a table of cell values from a raster, or set of rasters, for defined locations. The locations are defined by raster cells, polygon features, polyline features, or by a set of points.
The input rasters can be two-dimensional or multidimensional. The structure of the output table changes when the input rasters are multidimensional.
Licencia:
You must license your ArcGIS Server as an ArcGIS Image Server to use this resource.Request parameters
Parameter | Details |
---|---|
inRasters (Required) | List of input rasters. The input raster can be the Portal Item ID, Image Service URL, cloud raster dataset, or shared multidimensional raster dataset. 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: List of JSON object describing the input rasters.
|
inLocationData (Required) | Data identifying positions where you want a sample taken. The input can be an image service or a feature service. Syntax: JSON object describing the input raster or feature. At least one type of input needs to be provided in the JSON object. If multiple inputs are given, the itemid takes the priority. Example
|
outputName (Required) | Name of the output table or feature service holding the sampled cell values. Syntax: JSON object describing the output table Example
|
resamplingType | Resampling algorithm used when sampling a raster.
Syntax: A string representing the resamplingType. Example
|
uniqueIdField | A field containing a different value for every location or feature in the input location raster or point features. Syntax: A string representing the field. Example
|
acquisitionDefinition | Specify the time, depth or other acquisition data associated with the location features. Statistics will be calculated for variables within the dimension range of the following combinations:
Only non-negative values are supported for the following:
Syntax: a list of dictionary objects.
Example
|
statisticsType | The type of statistic to be calculated.
A string representing the statisticsType. Example
|
percentileValue | The percentile to calculate when the statisticsType parameter is set to PERCENTILE. This value can range from 0 to 100. The default is 90. Syntax: A double representing the percentileValue. Example
|
bufferDistance | The specified distance around the location data features. The buffer distance is specified in the linear unit of the location feature's spatial reference. If the feature uses a geographic reference, the unit will be in degrees. Statistics will be calculated within this buffer area. Syntax: A value representing the bufferDistance. Example 1
Syntax: A string representing the buffer distance field in the inLocationData. Example 2
|
layout | Specifies whether sampled values appear in rows or columns in the output table.
Syntax: A string of one of the keywords. Example
|
generateFeatureClass | Boolean value to determine if this tool generates an output feature service containing a feature class with sampled values or only a table with sampled values. The default is false. Values: true | false |
context (Optional) | Contains additional settings that affect task execution. This task has the following settings:
Example
|
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:{ "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:
https://<analysis url>/Sample/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:
https://<raster analysis url>/Sample/jobs/<jobId>/results/outSample?token=<your token>&f=json
Parameter | Description |
---|---|
outSample | The output feature service itemId and URL: Example:
The result 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.
|