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

For other keyword-only arguments, see the NumPy ufunc docs.

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))>