geopandas.overlay

geopandas.overlay(df1, df2, how='intersection', make_valid=True, use_sindex=None)

Perform spatial overlay between two polygons.

Currently only supports data GeoDataFrames with polygons. Implements several methods that are all effectively subsets of the union.

Parameters:

df1 : GeoDataFrame with MultiPolygon or Polygon geometry column

df2 : GeoDataFrame with MultiPolygon or Polygon geometry column

how : string

Method of spatial overlay: ‘intersection’, ‘union’, ‘identity’, ‘symmetric_difference’ or ‘difference’.

Returns:

df : GeoDataFrame

GeoDataFrame with new set of polygons and attributes resulting from the overlay