shapely.minimum_bounding_circle#

minimum_bounding_circle(geometry, **kwargs)#

Computes the minimum bounding circle that encloses an input geometry.

Note

‘minimum_bounding_circle’ requires at least GEOS 3.8.0.

Parameters:
geometryGeometry or array_like
**kwargs

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

Examples

>>> from shapely import GeometryCollection, LineString, MultiPoint, Point, Polygon
>>> minimum_bounding_circle(Polygon([(0, 0), (0, 10), (10, 10), (10, 0), (0, 0)]))
<POLYGON ((12.071 5, 11.935 3.621, 11.533 2.294, 10.879 1.07...>
>>> minimum_bounding_circle(LineString([(1, 1), (10, 10)]))
<POLYGON ((11.864 5.5, 11.742 4.258, 11.38 3.065, 10.791 1.9...>
>>> minimum_bounding_circle(MultiPoint([(2, 2), (4, 2)]))
<POLYGON ((4 2, 3.981 1.805, 3.924 1.617, 3.831 1.444, 3.707...>
>>> minimum_bounding_circle(Point(0, 1))
<POINT (0 1)>
>>> minimum_bounding_circle(GeometryCollection([]))
<POLYGON EMPTY>