bounds#

geodesic.boson.bounds(input_collection=None, output_collection=None)[source]#

Calculate the bounds of the queried geometry.

This middleware will calculate the bounds of the geometry and return it in a new collection called “bounds”. The bounds in this case are a rectangle that encloses the geometry. In the case of multi-geometries, the bounds of the entire geometry will be calculated.

When creating this middleware, most of the time you will want to apply it after any filtering happens, so that the centroid is calculated on the filtered geometry.

Parameters:
  • input_collection (str, optional) – name of the input collection to apply transform to. Defaults to None (all collections)

  • output_collection (str, optional) – name of the virtual collection that the transform will be applied to. Defaults to None (no virtual collection created)

Returns:

middleware to calculate the bounds of the queried geometry

Return type:

Middleware

Examples

>>> # Add the bounds middleware to a dataset view
>>> ds_with_bounds = ds.view(
...     middleware=[
...         bounds()
...     ]
... )