Spatial Aggregation

Learn how to use spatial aggregation to summarize values in larger scales.

We'll cover the following

Spatial aggregation is the process of grouping or combining spatial features based on a common attribute and aggregating the values of other attributes within each group. In many cases, spatial data may be more granular than what is needed for the analysis at hand. So, spatial aggregation involves combining finer geographic areas into larger units based on some criterion and then summarizing the data for each unit.

For example, if we have data on census tracts, but we’re actually interested in studying patterns at the level of zip codes or counties, we may need to aggregate the data to a coarser scale to make it more meaningful. By aggregating the data to a coarser scale, such as neighborhoods or counties, we can identify larger-scale patterns and relationships that may not be immediately apparent at a more granular scale.

Spatial aggregation in GeoPandas is performed with the dissolve() method and it can be compared to its nonspatial counterpart, performed with groupby(). However, one key difference is that the dissolve() method actually creates new geometries based on the grouping procedure (figure below).

Get hands-on with 1200+ tech skills courses.