Spatial Aggregation calculates statistics in areas where an input layer overlaps a boundary layer.
Example
A business analyst for a consortium of colleges is doing research for a marketing campaign in states with highvalue colleges and wants to know which state has the most colleges with a high return on investment (ROI). Spatial Aggregation can be used to aggregate the colleges into states to find the number of colleges with above average ROI.
See the Solve a spatial problem quick exercise for the complete workflow.
Use the Spatial Aggregation capability
Spatial Aggregation can be run on maps with two layers: one area layer with the boundaries that will be used for aggregation (for example, counties, census tracts, or police districts) and one layer to aggregate.
Use the following steps to run the Spatial Aggregation analysis capability:
 If necessary, click the map card to activate it. A card is active when the toolbar and Action button appear.
 Click the Action button, then choose Spatial Aggregation.
 For Choose area layer, select the boundary layer. For Choose layer to summarize, select the layer to aggregate.
 For Style By, select the field or statistic that you want to calculate and display. Use Additional options to select additional fields and statistics, if necessary.
 Click Run.
Tip:
Spatial Aggregation can also be run by dragging a dataset onto the Spatial aggregation drop zone on an existing map.
Usage notes
The Choose area layer and Choose layer to summarize parameters are used to select the boundary layer and the layer that will be summarized. For the Choose area layer parameter, only layers with area features will be available.
The Style By parameter can be used to change the statistic being calculated. The default statistic depends on the type of layer being summarized. The dropdown menu can be used to select a different style option. The following table summarizes the Style By options for each layer type:
Summary layer type  Default style option  Other style options 

Point  Count  Number or rate/ratio field (sum, minimum, maximum, or average) 
Line  Number (sum) or rate/ratio (average) field  Number or rate/ratio field (sum, minimum, maximum, or average) Sum of length (meters, kilometers, feet, or miles) 
Area  Number (sum) or rate/ratio (average) field  Number or rate/ratio field (sum, minimum, maximum, or average) Sum of area (square meters, square kilometers, square feet, or square miles) 
Note:
It is best practice to use numbers rather than rate/ratios when calculating statistics for lines and areas so that the proportional calculations make logical sense. For more information, see How Spatial Aggregation works.
The Additional Options parameter can be expanded and extra statistics can be assigned. Each time a field is added to the list of summary statistics, a new field will appear below it.
Limitations
When you perform spatial aggregation or spatial filtering on data from the same database connection, you must ensure that all the data is stored in the same spatial reference system. For datasets from SQL Server, the data must also have the same data type (geography or geometry).
Note:
Database connections are available in Insights in ArcGIS Enterprise and Insights desktop.
How Spatial Aggregation works
Average statistics are calculated using weighted mean for line and area features. The following equation is used to calculate weighted mean:
where:
N = number of observations
x_{i} = observations
W_{i} = weights
Points
Point layers are summarized using only the point features within the input boundary. Therefore, none of the calculations are weighted.
The figure and table below explain the statistical calculations of a point layer within a hypothetical boundary. The Population field was used to calculate the statistics (count, sum, minimum, maximum, and average) for the layer.
Statistic  Result District A  Result District B 

Count  6  6 
Sum 


Minimum  Minimum of:
 Minimum of:

Maximum  Maximum of:
 Maximum of:

Average 


A reallife scenario in which this analysis could be used is in determining the total number of students in each school district. Each point represents a school. The Type field gives the type of school (elementary, middle school, or secondary) and a student population field gives the number of students enrolled at each school. The calculations and results are given in the table above. From the results you can see that District A has 2,568 students and District B has 3,400 students.
Lines
Line layers are summarized using only the proportions of the line features that are within the input boundary. When summarizing lines, use fields with counts and amounts rather than rates or ratios so proportional calculations make logical sense in your analysis. The results will be displayed using graduated symbols.
The figure and table below explain the statistical calculations of a line layer within a hypothetical boundary. The Volume field was used to calculate the statistics (length, sum, minimum, maximum, and average) for the layer. The statistics are calculated using only the proportion of the lines that are within the boundary.
Statistic  Result 

Sum of length 
Note:Length can also be calculated in feet, meters, and kilometers. 
Sum 

Minimum  Minimum of:

Maximum  Maximum of:

Average 

A reallife scenario in which this analysis could be used is in determining the total volume of water in rivers within the boundaries of a state park. Each line represents a river that is partially located inside the park. From the results, you can see that there are 5 miles of rivers within the park and the total volume is 900 units.
Areas
Area layers are summarized using only the proportions of the area features that are within the input boundary. When summarizing areas, use fields with counts and amounts rather than rates or ratios so proportional calculations make logical sense in your analysis. The results layer will be displayed using graduated colors.
The figure and table below explain the statistical calculations of an area layer within a hypothetical boundary. The populations were used to calculate the statistics (area, sum, minimum, maximum, and average) for the layer. The statistics are calculated using only the proportion of the area that is within the boundary.
Statistic  Result 

Sum of area 
Note:Area can also be calculated in square feet, square meters, and square kilometers. 
Sum 

Minimum  Minimum of:

Maximum  Maximum of:

Average 

A reallife scenario in which this analysis could be used is in determining the population in a city neighborhood. The blue outline represents the boundary of the neighborhood and the smaller areas represent census blocks. From the results, you can see that there are 10,841 people in the neighborhood and an average of approximately 2,666 people per census block.