convex_hull#

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

Calculate the convex hull of the queried geometry.

This middleware will calculate the convex hull of the geometry and return it in a new collection called “convex_hull”. The convex hull is the smallest convex polygon that encloses the geometry. In the case of multi-geometries, the convex hull 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 convex hull of the queried geometry

Return type:

Middleware

Examples

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