shapely.envelope#

envelope(geometry, **kwargs)#

Computes the minimum bounding box that encloses an input geometry.

Parameters
geometryGeometry or array_like
**kwargs

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

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>