shapely.bounds#
- bounds(geometry, **kwargs)#
Compute the bounds (extent) of a geometry.
For each geometry these 4 numbers are returned: min x, min y, max x, max y.
- Parameters:
- geometryGeometry or array_like
Geometry or geometries for which to compute the bounds.
- **kwargs
See NumPy ufunc docs for other keyword arguments.
Examples
>>> import shapely >>> from shapely import LineString, Point, Polygon >>> shapely.bounds(Point(2, 3)).tolist() [2.0, 3.0, 2.0, 3.0] >>> shapely.bounds(LineString([(0, 0), (0, 2), (3, 2)])).tolist() [0.0, 0.0, 3.0, 2.0] >>> shapely.bounds(Polygon()).tolist() [nan, nan, nan, nan] >>> shapely.bounds(None).tolist() [nan, nan, nan, nan]