Aggregate Points (GeoAnalytics)

Summary

Aggregates points into polygon features or bins. A polygon is returned with a count of points as well as optional statistics at all locations where points exist.

Learn more about how time stepping works

Illustration

Aggregate Points tool
Examples of aggregating points into polygons (first row), time-enabled points into polygons with time stepping (second row), points into bins (third row), and points into bins with time stepping (fourth row) are shown.

Usage

  • The two ways to specify the areas into which the points will be aggregated are as follows:

    • Use a polygon layer.
    • Use a square or hexagonal bin of a specified size that is generated when the analysis is run.

    You can provide the area layer to use for analysis, or you can generate bins of a specified size and shape (hexagon or square) into which to aggregate. The bin size specifies how large the bins are. If you are aggregating into hexagons, the size is the height of each hexagon, and the width of the resulting hexagon will be 2 times the height divided by the square root of 3. If you are aggregating into squares, the bin size is the height of the square, which is equal to the width.

    Hexagonal and square bins
  • Aggregate Points requires that the Point Layer is projected or that the output coordinate system is set to a projected coordinate system. If your data is not in a projected coordinate system and you do not set a projected processing coordinate system, a projection will be assigned based on the extent of the data you are analyzing.

  • The output feature layer is always a polygon layer. Only polygons that contain points will be returned, and resulting polygons will be completely removed from the result layer.

    Polygons returned with point features
    The input point and polygon features (left) and the resulting area features (right) from Aggregate Points are shown.

  • The most basic aggregations will calculate a count of the number of points in each polygon. Statistics (count, sum, minimum, maximum, range, mean, standard deviation, and variance) can also be calculated on numerical fields, and statistics (count, any) can be calculated on string fields. The statistics will be calculated on each area separately. If you specify a statistic that is not valid (mean of a string field), it will be skipped.

    Note:

    When count is applied to a field, it returns a count of the nonnull values present in the field. When any is applied to a string field, it returns a single string present in the field.

  • If time is enabled on the input, you can apply time stepping to your analysis. Each time step is analyzed independent of features outside the time step. To use time stepping, your input data must be time enabled and represent an instant in time. When time stepping is applied, output features will be time intervals represented by the START_DATETIME and END_DATETIME fields.

    Learn more about time stepping

  • If you specify a time-step interval, time-step repeat, or reference time, and time is not enabled on the data, the tool will result in an error.

  • The Time Step Reference parameter can be a date and time value or solely a date value; it cannot be solely a time value.

  • The following fields are included in the output features:

    Field nameDescription

    count

    The count of features within each polygon.

    statistic_fieldname

    Specified statistics will each create an attribute field, named in the following format: statistic_fieldname. For example, the maximum and standard deviation of the id field are MAX_id and SD_id, respectively.

    start_date

    When time stepping is specified, output polygons will have a time interval. This field represents the start time.

    end_date

    When time stepping is specified, output polygons will have a time interval. This field represents the end time.

  • You can improve the performance of the Aggregate Points tool by using one or more of the following tips:

    • Set the extent environment so you only analyze data of interest.
    • Larger bins will perform better than smaller bins. If you are unsure about which size to use, start with a larger bin to prototype.
    • Similar to bins, larger time steps will perform better than smaller time steps.
    • Use data that is local to where the analysis is being run.

  • This geoprocessing tool is powered by ArcGIS GeoAnalytics Server. Analysis is completed on your GeoAnalytics Server, and results are stored in your content in ArcGIS Enterprise.

  • When running GeoAnalytics Server tools, the analysis is completed on the GeoAnalytics Server. For optimal performance, make data available to the GeoAnalytics Server through feature layers hosted on your ArcGIS Enterprise portal or through big data file shares. Data that is not local to your GeoAnalytics Server will be moved to your GeoAnalytics Server before analysis begins. This means that it will take longer to run a tool, and in some cases, moving the data from ArcGIS Pro to your GeoAnalytics Server may fail. The threshold for failure depends on your network speeds, as well as the size and complexity of the data. It is recommended that you always share your data or create a big data file share.

    Learn more about sharing data to your portal

    Learn more about creating a big data file share through Server Manager

  • Similar analysis can also be completed using the Aggregate Points tool in the Standard Feature Analysis toolbox.

Parameters

LabelExplanationData Type
Point Layer

The point features to be aggregated into polygons or bins.

Feature Set
Output Name

The name of the output feature service.

String
Polygon or Bin

Specifies how the Point Layer will be aggregated.

  • PolygonThe point layer will be aggregated into a polygon dataset.
  • BinThe point layer will be aggregated into square or hexagonal bins that are generated when the tool is run.
String
Polygon Layer
(Optional)

The polygon features into which the input points will be aggregated.

Feature Set
Bin Type
(Optional)

Specifies the bin shape that will be generated to hold the aggregated points.

  • SquareSquare bins will be generated, in which Bin Size represents the height of a square. This is the default.
  • HexagonHexagonal bins will be generated, in which Bin Size represents the height between two parallel sides.
String
Bin Size
(Optional)

The distance interval that represents the bin size and units into which the Point Layer will be aggregated. The distance interval must be a linear unit.

The distance interval that represents the Bin Size and units into which the Point Layer will be aggregated. The distance interval must be a linear unit.

Linear Unit
Time Step Interval
(Optional)

A value that specifies the duration of the time step. This parameter is only available if the input points are time enabled and represent an instant in time.

Time stepping can only be applied if time is enabled on the input.

Time Unit
Time Step Repeat
(Optional)

A value that specifies how often the time-step interval occurs. This parameter is only available if the input points are time enabled and represent an instant in time.

Time Unit
Time Step Reference
(Optional)

A date that specifies the reference time with which to align the time steps. The default is January 1, 1970, at 12:00 a.m. This parameter is only available if the input points are time enabled and represent an instant in time.

Date
Summary Fields
(Optional)

The statistics that will be calculated on specified fields.

Value Table
Data Store
(Optional)

Specifies the ArcGIS Data Store where the output will be saved. The default is Spatiotemporal big data store. All results stored in a spatiotemporal big data store will be stored in WGS84. Results stored in a relational data store will maintain their coordinate system.

  • Spatiotemporal big data storeOutput will be stored in a spatiotemporal big data store. This is the default.
  • Relational data storeOutput will be stored in a relational data store.
String

Derived Output

LabelExplanationData Type
Output Feature Layer

The aggregated polygon features or bins.

Feature Set

arcpy.geoanalytics.AggregatePoints(point_layer, output_name, polygon_or_bin, {polygon_layer}, {bin_type}, {bin_size}, {time_step_interval}, {time_step_repeat}, {time_step_reference}, {summary_fields}, {data_store})
NameExplanationData Type
point_layer

The point features to be aggregated into polygons or bins.

Feature Set
output_name

The name of the output feature service.

String
polygon_or_bin

Specifies how the point_layer will be aggregated.

  • POLYGONThe point layer will be aggregated into a polygon dataset.
  • BINThe point layer will be aggregated into square or hexagonal bins that are generated when the tool is run.
String
polygon_layer
(Optional)

The polygon features into which the input points will be aggregated.

Feature Set
bin_type
(Optional)

Specifies the bin shape that will be generated to hold the aggregated points.

  • SQUARESquare bins will be generated. in which bin_size represents the height of a square. This is the default.
  • HEXAGONHexagonal bins will be generated, in which bin_size represents the height between two parallel sides.
String
bin_size
(Optional)

The distance interval that represents the bin size and units into which the point_layer will be aggregated. The distance interval must be a linear unit.

Linear Unit
time_step_interval
(Optional)

A value that specifies the duration of the time step. This parameter is only available if the input points are time enabled and represent an instant in time.

Time stepping can only be applied if time is enabled on the input.

Time Unit
time_step_repeat
(Optional)

A value that specifies how often the time-step interval occurs. This parameter is only available if the input points are time enabled and represent an instant in time.

Time Unit
time_step_reference
(Optional)

A date that specifies the reference time with which to align the time steps. The default is January 1, 1970, at 12:00 a.m. This parameter is only available if the input points are time enabled and represent an instant in time.

Date
summary_fields
[summary_fields,...]
(Optional)

The statistics that will be calculated on specified fields.

  • COUNT—The number of nonnull values. It can be used on numeric fields or strings. The count of [null, 0, 2] is 2.
  • SUM—The sum of numeric values in a field. The sum of [null, null, 3] is 3.
  • MEAN—The mean of numeric values. The mean of [0,2, null] is 1.
  • MIN—The minimum value of a numeric field. The minimum of [0, 2, null] is 0.
  • MAX—The maximum value of a numeric field. The maximum value of [0, 2, null] is 2.
  • STDDEV—The standard deviation of a numeric field. The standard deviation of [1] is null. The standard deviation of [null, 1,1,1] is null.
  • VAR—The variance of a numeric field in a track. The variance of [1] is null. The variance of [null, 1,1,1] is null.
  • RANGE—The range of a numeric field. This is calculated as the minimum value subtracted from the maximum value. The range of [0, null, 1] is 1. The range of [null, 4] is 0.
  • ANY—A sample string from a field of type string.

Value Table
data_store
(Optional)

Specifies the ArcGIS Data Store where the output will be saved. The default is SPATIOTEMPORAL_DATA_STORE. All results stored in a spatiotemporal big data store will be stored in WGS84. Results stored in a relational data store will maintain their coordinate system.

  • SPATIOTEMPORAL_DATA_STOREOutput will be stored in a spatiotemporal big data store. This is the default.
  • RELATIONAL_DATA_STOREOutput will be stored in a relational data store.
String

Derived Output

NameExplanationData Type
output

The aggregated polygon features or bins.

Feature Set

Code sample

AggregatePoints (Python window)

The following Python window script demonstrates how to use the AggregatePoints tool.

#-------------------------------------------------------------------------------
# Name: AggregatePoints.py
# Description: Aggregate 311 events into 1 KM Bins.
#
# Requirements: ArcGIS GeoAnalytics Server

# Import system modules
import arcpy

# Set local variables
inFeatures = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/0"
summaryFields = ["Year", "Beat"]
summaryStatistics = [["Arrest", "COUNT"], ["District", "COUNT"]]
outFS = "AggregateWildfires"
dataStore = "SPATIOTEMPORAL_DATA_STORE"

# Execute Aggregate Points
arcpy.geoanalytics.AggregatePoints(inFeatures, outFS, "BIN", None, "HEXAGON", 
                                   "1 Kilometers", None, None, None, None, 
                                   dataStore)

Environments

Special cases

Output Coordinate System

The coordinate system that will be used for analysis. Analysis will be completed in the input coordinate system unless specified by this parameter. For GeoAnalytics Tools, final results will be stored in the spatiotemporal data store in WGS84.

Licensing information

  • Basic: Requires ArcGIS GeoAnalytics Server
  • Standard: Requires ArcGIS GeoAnalytics Server
  • Advanced: Requires ArcGIS GeoAnalytics Server

Related topics