shapely.build_area

Contents

shapely.build_area#

build_area(geometry, **kwargs)#

Creates an areal geometry formed by the constituent linework of given geometry.

Note

‘build_area’ requires at least GEOS 3.8.0.

Equivalent of the PostGIS ST_BuildArea() function.

Parameters:
geometryGeometry or array_like
**kwargs

See NumPy ufunc docs for other keyword arguments.

Examples

>>> from shapely import GeometryCollection, Polygon
>>> polygon1 = Polygon([(0, 0), (3, 0), (3, 3), (0, 3), (0, 0)])
>>> polygon2 = Polygon([(1, 1), (1, 2), (2, 2), (1, 1)])
>>> build_area(GeometryCollection([polygon1, polygon2]))
<POLYGON ((0 0, 0 3, 3 3, 3 0, 0 0), (1 1, 2 2, 1 2, 1 1))>