shapely.convex_hull

Contents

shapely.convex_hull#

convex_hull(geometry, **kwargs)#

Compute the minimum convex geometry that encloses an input geometry.

Parameters:
geometryGeometry or array_like

Geometry or geometries for which to compute the convex hull.

**kwargs

See NumPy ufunc docs for other keyword arguments.

Examples

>>> import shapely
>>> from shapely import MultiPoint, Polygon
>>> shapely.convex_hull(MultiPoint([(0, 0), (10, 0), (10, 10)]))
<POLYGON ((0 0, 10 10, 10 0, 0 0))>
>>> shapely.convex_hull(Polygon())
<GEOMETRYCOLLECTION EMPTY>