The Find Centroids task finds and generates points from the representative center (centroid) of each input multipoint, line, or area feature. Finding the centroid of a feature is common for many analytical workflows in which the resulting points can then be used in other analytic workflows.
For example, polygon features that contain demographic data can be converted to centroids that can be used in network analysis.
Request URL
http://<analysis url>/FindCentroids/submitJob
Request parameters
Parameter | Description |
---|---|
inputLayer (Required) | The multipoint, line, or polygon features that will be used to generate centroid point features. Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:
Examples:
|
pointLocation | A Boolean value that determines the output location of the points. Values: true | false
Example:"pointLocation" : "false" |
outputName | If provided, the task will create a feature service of the results. You define the name of the service. If an outputName value is not provided, the task will return a feature collection. Syntax: Syntax: |
context | The Context parameter contains the following additional settings that affect task operation:
Syntax:
|
f | The response format. The default response format is html. Values: html | json |
Response
When you submit a request, the service assigns a unique job ID for the transaction.
{
"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 the Checking job status topic.
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:http://<analysis url>/FindCentroids/jobs/<jobId>
Results access
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:
http://<analysis url>/FindCentroids/jobs/<jobId>/results/outputLayer?token=<your token>&f=json
Parameter | Description |
---|---|
outputLayer | The centroid points. The result has properties for parameter name, data type, and value. The contents of value depend on the outputName parameter provided in the initial request.
See Feature Output for more information about how the result layer or collection is accessed. |