- URL:
- https://<geoanalytics-url>/AggregatePoints
- Methods:
GET
- Version Introduced:
- 10.5
Description
The Aggregate
operation works with a layer of point features and a layer of areas. The layer of areas can be an
input polygon layer or it can be square, hexagonal, or H3 bins calculated when the task is run. The tool first determines
which points fall within each specified area. After determining this point-in-area spatial relationship, statistics about
all points in the area are calculated and assigned to the area. The most basic statistic is the count of the number of
points within the area, but you can get other statistics as well.
For example, suppose you have point features of coffee shop locations and area features of countries, and you want to
summarize coffee sales by county. Assuming the coffee shops have a TOTAL
attribute, you can get the sum of all
TOTAL
within each county, the minimum or maximum TOTAL
within each county, or other statistics like the
count, range, standard deviation, and variance.
This tool can also work on data that is time-enabled. If time is enabled on the input points, then the time stepping options are available. Time stepping allows you to calculate the point-in area relationship while looking at a specific step in time. For example, you could look at hourly intervals, which would result in outputs for each hour.
For an example with time, suppose you had point features of every transaction made at a coffee shop location and no
area layer. The data has been recorded over a year, and each transaction has a location and a time stamp. Assuming each
transaction has a TOTAL
attribute, you can get the sum of all TOTAL
within the space and time of
interest. If these transactions are for a single city, we could generate areas that are one kilometer grids, and look at
weekly time slices to summarize the transactions in both time and space.
Request parameters
Parameter | Details |
---|---|
| The point features that will be aggregated into the polygons in the Syntax: As described in Feature input, this parameter can be one of the following:
REST examples
|
| The type of bin that will be generated and into which points will be aggregated. When generating bins for Values: REST examples
|
| The distance for the bins of type REST examples
|
| The distance unit for the bins that the Values: REST examples
|
| This parameter is available at ArcGIS GeoAnalytics Server 11.2 or later.
The resolution of H3 bins that the REST examples
|
| The polygon features (areas) into which the input points will be aggregated. This operation is not required if Syntax: As described in Feature input, this parameter can be one of the following:
REST examples
|
|
A numeric value that specifies duration of the time step interval. The default is none. This option is only available if the input points are time enabled and represent an instant in time. REST examples
|
|
A string that specifies units of the time step interval. The default is none. This option is only available if the input points are time enabled and represent an instant in time. REST examples
|
|
A numeric value that specifies how often the time step repeat occurs. The default is none. This option is only available if the input points are time enabled and of time type instant. REST examples
|
|
A string that specifies the temporal unit of the step repeat. The default is none. This option is only available if the input points are time enabled and of time type instant. REST examples
|
|
A date that specifies the reference time to align the time slices to, represented in milliseconds from epoch. The default is January 1, 1970, at 12:00 a.m. (epoch time stamp 0). This option is only available if the input points are time enabled and of time type instant. REST examples
|
|
A list of field names and statistical summary types you want to calculate. Note that the count is always returned. By default, all statistics are returned. Note that the
REST examples
|
|
The task will create a feature service of the results. You define the name of the service. REST examples
|
|
The
Syntax:
|
|
The response format. The default response format is Values: |
Example usage
Below is a sample request URL for Aggregate
:
https://webadaptor.domain.com/server/rest/services/System/GeoAnalyticsTools/GPServer/AggregatePoints/submitJob?pointLayer={"url":"https://webadaptor.domain.com/server/rest/services/Hurricane/hurricaneTrack/0"}&binType=Square&binSize=100&binSizeUnit=Meters&polygonLayer={}&timeStepInterval=20&timeStepIntervalUnit=Minutes&timeStepRepeatInterval=1&timeStepRepeatIntervalUnit=Days&timeStepReference=946684800000&summaryFields=[{"statisticType": "Mean","onStatisticField":"Annual_Sales"},{"statisticType":"Sum","onStatisticField":"Annual_Sales"}]&outputName=myOutput&context={"extent":{"xmin":-122.68,"ymin":45.53,"xmax":-122.45,"ymax":45.6,"spatialReference":{"wkid":4326}}&f=json
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 job
to periodically check the status of the job and messages as described in Check 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:
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:
https://<analysis-url>/AggregatePoints/jobs/<jobId>/results/output?token=<your token>&f=json
Response | Description |
---|---|
|
the resulting polygon features would have two attributes,
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 is accessed. |