bounding

Utilities for working with bounding boxes

svgis.bounding.check(bounds)

Check if bounds are valid.

svgis.bounding.covers(b1, b2)

Return True if b1 covers b2.

Parameters:
  • b1 (tuple) – A bounding box (minx, miny, maxx, maxy)
  • b2 (tuple) – A bounding box
svgis.bounding.pad(bounds, ext=100)

Pad a bounding box. Works best when input is in feet or meters or something.

svgis.bounding.ring(bounds)

Convert min, max points to a boundary ring.

svgis.bounding.transform(in_crs, out_crs, bounds)

Project a bounding box, taking care to not slice off the sides.

Parameters:
  • in_crs (dict) – Fiona-type proj4 mapping representing input projection.
  • out_crs (dict) – Fiona-type proj4 mapping representing output projection.
  • bounds (tuple) – bounding box to transform.
Returns:

tuple

svgis.bounding.update(old, new)

Extend old with any more distant values from newpoints. Also replace any missing min/max points in old with values from new.