maps.domains.bounds

Module Contents

Functions

from_bbox(extents, crs[, src_crs])

Get a bounding box which entirely contains another box from a different CRS.

from_geometry(geom[, crs])

Get a bounding box around a geometry on a given coordinate reference system.

to_string(bounds)

Convert a list of lat-lon bounds to a human-readable string.

Attributes

CYCLIC_SYSTEMS

maps.domains.bounds.CYCLIC_SYSTEMS = ['PlateCarree', 'Mercator']
maps.domains.bounds.from_bbox(extents, crs, src_crs=None)

Get a bounding box which entirely contains another box from a different CRS.

Parameters:
  • extents (list) – The x and y extents of the bounding box on the src_crs, given as [min_x, max_x, min_y, max_y].

  • crs (cartopy.crs.CRS) – The coordinate reference system in which to generate a new bounding box which entriely contains the given extents.

  • src_crs (cartopy.crs.CRS (optional)) – The coordinate reference system on which the extents are defined. If not passed, an equirectangular CRS will be assumed, with extents defined as latitudes and longitudes.

Return type:

list

maps.domains.bounds.from_geometry(geom, crs=None)

Get a bounding box around a geometry on a given coordinate reference system.

Parameters:
  • geom (shapely.geometry) – A shapely geometry around which the bounding box should be drawn.

  • crs (cartopy.crs.CRS) – The coordinate reference system in which to generate a new bounding box which entriely contains the given geometry.

Return type:

list

maps.domains.bounds.to_string(bounds)

Convert a list of lat-lon bounds to a human-readable string.

Parameters:

bounds (list) – A list of latitude-longitude bounds in the order [min_lon, max_lon, min_lat, max_lat].

Return type:

str