Skip To Content

Spatial Aggregation

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 high-value 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:

  1. If necessary, click the map card to activate it. A card is active when the toolbar and Action button Action appear.
  2. Click the Action button, then choose Spatial Aggregation.
  3. For Choose area layer, select the boundary layer. For Choose layer to summarize, select the layer to aggregate.
  4. 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.
  5. Click Run.
Tip:

Drag-N Drop 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 drop-down menu can be used to select a different style option. The following table summarizes the Style By options for each layer type:

Summary layer typeDefault style optionOther 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:

Equation to calculate weighted mean
where:
N = number of observations
xi = observations
Wi = 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.

Aggregating a point layer

StatisticResult District AResult District B

Count

6

6

Sum

280 + 408 + 356 + 361 + 450 + 713 = 2,568
370 + 422 + 495 + 607 + 574 + 932 = 3,400

Minimum

Minimum of:

[280 408 356 361 450 713] = 280

Minimum of:

[370 422 495 607 574 932] = 370

Maximum

Maximum of:

[280 408 356 361 450 713] = 713

Maximum of:

[370 422 495 607 574 932] = 932

Average

2,568/6 = 428

3,400/6 = 566.67

A real-life 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.

Summarizing a line layer

StatisticResult

Sum of length

2 miles + 3 miles = 5 miles
Note:

Length can also be calculated in feet, meters, and kilometers.

Sum

400 + 500 = 900

Minimum

Minimum of:

[400 500] = 400

Maximum

Maximum of:

[400 500] = 500

Average

((2*400)+(3*500))/(2+3)
= 460

A real-life 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.

Summarizing an area layer

StatisticResult

Sum of area

4 mi2 + 4 mi2 + 1 mi2 + 6 mi2 + 2 mi2 = 17 mi2
Note:

Area can also be calculated in square feet, square meters, and square kilometers.

Sum

2,133 + 3,133 + 400 + 3,375 + 1,800 = 10,841

Minimum

Minimum of:

[2,133 3,133 400 3,375 1,800] = 400

Maximum

Maximum of:

[2,133 3,133 400 3,375 1,800] = 3,375

Average

((4*2,133)+(4*3,133)+(2*1,800)+(6*3,375)+(1*400))/(4+4+2+6+1)
= 2,665.53

A real-life 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.