- URL:
- https://<rasteranalysistools-url>/Segment
- Methods:
GET
- Version Introduced:
- 10.6.1
Description
The Segment
task groups together adjacent pixels having similar spectral and spatial characteristics into segments, known as objects. The input raster dataset can be clipped, resampled, and reprojected based on the setting.
Request parameters
Parameter | Details |
---|---|
(Required) | The complete JSON rft (uri or by value), the complete XML rft (uri or by value), portal item ID, image service URL, cloud raster dataset, or shared raster dataset that will be segmented. If multiple inputs are given, then Syntax: A string describes the input raster. Example:
|
(Required) | The location where the service will generate the output raster. Syntax: JSON object that describes the output raster. Example:
|
| Sets the level of importance given to the spectral differences of features in your imagery. Valid values range fro 1.0-20.0. A high value is appropriate when you have features you want to classify separately but have somewhat similar spectral characteristics. Smaller values create spectrally smoother outputs. For example, setting a higher spectral detail value for a forested scene will preserve greater discrimination between the different tree species, resulting in more segments. Example
|
| Sets the level of importance given to the proximity between features in your imagery. Valid values range from 1-20. A high value is appropriate for a scene where your features of interest are small and clustered together. Smaller values create spatially smoother outputs. For example, in an urban scene you could classify an impervious surface using a smaller spatial detail, or you could classify buildings and roads as separate classes using a higher spatial detail. Example
|
| Merges segments smaller than this size with their best fitting neighbor segment. This is related to the minimum mapping unit for a mapping project. Units are in pixels. Example
|
| Defines which 3 bands are used in segmentation. Choose the bands that visually discriminate your features of best interest. The value is a string of three numbers separated by three commas. Example
|
| If the value is false or 0, the tool will not run to remove tiling artifacts after segmentation. The result may seem blocky at some tiling boundaries. Example
|
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 job
to periodically review the status of the job and messages as described in Checking job status. Once the job has successfully completed, use job
to retrieve the results. To track the status, you can make a request of the following form:
https://<raster analysis tools url>/Segment/jobs/<jobId>
When the status of the job request is esri
, you can access the results of the analysis by making a request of the following form:
https://<raster analysis tools url>/Segment/jobs/<jobId>/results/outputRaster
Example usage
The following is a sample request URL for Segment
:
https://services.myserver.com/arcigs/rest/services/System/RasterAnalysisTools/GPServer/Segment/submitJob
JSON Request example
inputRaster={"itemId": "1780d648db3545bba8661ad98df824a4"}&
outputName={"itemId": "04180233981a4b978755d854687e149e"}&
spectralDetail=15.5&
spatialDetail=15&
minimumSegmentSizeInPixels=20&
bandIndexes="0,1,2"&
removeTilingArtifacts="true"
JSON Response example
The response returns the output
output parameters, which has properties for parameter name, data type, and value. The content of value is always the output raster dataset item
and the image service URL.
{
"paramName": "outputRaster",
"dataType": "GPString",
"value": {
"itemId": "f121390b85ef419790479fc75b493efd",
"url": "https://<server name>/arcgis/rest/services/Hosted/<service name>/ImageServer"
}
}