The Aggregate Points
task works with a layer of point features and a layer of polygon features or bins. It first identifies which points fall within each polygon's area. After identifying this point-in-polygon spatial relationship, statistics for all points in the polygon are calculated and assigned to the area. The most basic statistic is the number of points within the polygon (count), but you can get other statistics as well.
For example, if the points represent coffee shops and each point has a TOTAL_
attribute, you can get statistics such as the sum of all sales within the polygon, the minimum or maximum TOTAL_
value, or the standard deviation of all sales within the polygon.
Request URL
http://<analysis url>/AggregatePoints/submitJob
Request parameters
Parameter | Description |
---|---|
(Required) | The point features that will be aggregated into polygons in the Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:
Examples:
|
| The polygon features (areas) into which the input points will be aggregated. The Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:
|
| A Boolean value that specifies whether the polygons that have no points within them will be returned in the output. The default is Values: |
| A list of field names and statistical summary types that will be calculated for all points within each polygon. The count of points within each polygon is always returned. Syntax:
Example: |
| A field name in the You can create statistical groups using an attribute in the analysis layer. For example, if you are aggregating crimes to neighborhood boundaries, you may have a Example: When a |
| This Boolean parameter is applicable only when a The default is Values: |
| This Boolean parameter is applicable only when a |
|
If provided, the task will create a feature service of the results. You define the name of the service. If an Syntax:
In ArcGIS Online or ArcGIS Enterprise 10.9.1 and later, you can overwrite an existing feature service by providing the Syntax:
or
|
|
The Context parameter contains the following additional settings that affect task operation:
Syntax:
|
| The type of bin that will be generated and points will be aggregated into. Bin options are as follows:
Example: When generating bins, for |
| The distance used to calculate the size of the bins specified in the Example: |
| The linear unit to be used with the distance value specified in Values: The default is Example: |
| The response format. The default response format is Values: |
Response
When you submit a request, the service 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 job
to periodically check the status of the job and messages, as described in Check job status. Once the job has successfully completed, you use the job
to retrieve the results. To track the status, you can make a request of the following form:
http://<analysis url>/AggregatePoints/jobs/<jobId>
Accessing results
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:
http://<analysis url>/AggregatePoints/jobs/<jobId>/results/<output parameter name>?token=<your token>&f=json
Parameter | Description |
---|---|
|
The layer will inherit all the attributes of the input polygon layer and will have a If a
The result polygon features will have two attributes, Request example:
The result has properties for parameter name, data type, and value. The contents of
See Feature output for more information about how the result layer or collection is accessed. |
| If the The output table will have the following fields:
Request example:
The result has properties for parameter name, data type, and value. The contents of
See Feature output for more information about how the group summary table is accessed. |