gws.gis.bounds

Utilities to work with Bounds objects.

Source code: gws.gis.bounds

Package Contents

gws.gis.bounds.from_request_bbox(bbox: str, default_crs: gws.Crs = None, always_xy=False) gws.Bounds | None

Create Bounds from a KVP BBOX param.

See OGC 06-121r9, 10.2.3 Bounding box KVP encoding.

Parameters:
  • bbox – A string with four coordinates, optionally followed by a CRS spec.

  • default_crs – Default Crs.

  • always_xy – If True, coordinates are assumed to be in the XY (lon/lat) order

Returns:

A Bounds object.

gws.gis.bounds.from_extent(extent: gws.Extent, crs: gws.Crs, always_xy=False) gws.Bounds

Create Bounds from an Extent.

Parameters:
  • extent – An Extent.

  • crs – A Crs object.

  • always_xy – If True, coordinates are assumed to be in the XY (lon/lat) order

Returns:

A Bounds object.

gws.gis.bounds.copy(b: gws.Bounds) gws.Bounds
gws.gis.bounds.union(bs: list[gws.Bounds]) gws.Bounds
gws.gis.bounds.intersect(b1: gws.Bounds, b2: gws.Bounds) bool
gws.gis.bounds.transform(b: gws.Bounds, crs_to: gws.Crs) gws.Bounds
gws.gis.bounds.buffer(b: gws.Bounds, buf: int) gws.Bounds