utils.bounding_box_to_polygon#

seismostats.utils.bounding_box_to_polygon(x_min, x_max, y_min, y_max, srid=None) Polygon#

Create a shapely Polygon from a bounding box.

Parameters:
  • x_min – Minimum x coordinate.

  • x_max – Maximum x coordinate.

  • y_min – Minimum y coordinate.

  • y_max – Maximum y coordinate.

  • srid – Spatial reference system identifier.

Returns:

x – Shapely polygon in geographic coordinates.

Examples

>>> from seismostats.utils import bounding_box_to_polygon
>>> polygon = bounding_box_to_polygon(0, 1, 0, 1)
>>> x,y = polygon.exterior.xy
>>> x
array('d', [1.0, 1.0, 0.0, 0.0, 1.0])
>>> y
array('d', [0.0, 1.0, 1.0, 0.0, 0.0])