shapely.envelope

Contents

shapely.envelope#

envelope(geometry, **kwargs)#

Computes the minimum bounding box that encloses an input geometry.

Parameters:
geometryGeometry or array_like
**kwargs

See NumPy ufunc docs for other keyword arguments.

Examples

>>> from shapely import GeometryCollection, LineString, MultiPoint, Point
>>> envelope(LineString([(0, 0), (10, 10)]))
<POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))>
>>> envelope(MultiPoint([(0, 0), (10, 10)]))
<POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))>
>>> envelope(Point(0, 0))
<POINT (0 0)>
>>> envelope(GeometryCollection([]))
<POINT EMPTY>