The Find Centroids task that finds and generates points from the representative center (centroid) of each input multipoint, line, or area feature. Finding the centroid of a feature is very common for many analytical workflows where 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.
Find Centroids is only available in ArcGIS Online. This tool will be added to ArcGIS Enterprise in a future release.
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
A Boolean value that determines the output location of the points.
Values: true | false
Example:"pointLocation" : "false"
If provided, the task will create a feature service of the results. You define the name of the service. If outputName is not supplied, the task will return a feature collection.
Context contains additional settings that affect task execution. For Find Centroids, there are two settings.
The response format. The default response format is html.
Values: html | json
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 topic Checking job status.
Once the job has successfully completed, you use
the jobId to retrieve the results. To track the status, you can make a request of the following form:
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/centroidLayer?token=<your token>&f=json
The centroid points.
The result has properties for parameter name, data type, and value. The contents of value depends upon the outputName parameter provided in the initial request.
See Feature Output for more information about how the result layer or collection is accessed.