geopandas.GeoSeries.union_all#

GeoSeries.union_all()[source]#

Returns a geometry containing the union of all geometries in the GeoSeries.

Examples

>>> from shapely.geometry import box
>>> s = geopandas.GeoSeries([box(0,0,1,1), box(0,0,2,2)])
>>> s
0    POLYGON ((1 0, 1 1, 0 1, 0 0, 1 0))
1    POLYGON ((2 0, 2 2, 0 2, 0 0, 2 0))
dtype: geometry
>>> union = s.union_all()
>>> print(union)
POLYGON ((0 1, 0 2, 2 2, 2 0, 1 0, 0 0, 0 1))