sertit.vectors.from_polygon_to_bounds¶
- from_polygon_to_bounds(polygon: Union[shapely.geometry.polygon.Polygon, shapely.geometry.multipolygon.MultiPolygon]) -> (<class 'float'>, <class 'float'>, <class 'float'>, <class 'float'>)[source]¶
Convert a shapely.polygon to its bounds, sorted as left, bottom, right, top.
>>> poly = Polygon(((0., 0.), (0., 1.), (1., 1.), (1., 0.), (0., 0.))) >>> from_polygon_to_bounds(poly) (0.0, 0.0, 1.0, 1.0)