h3#
- geodesic.boson.h3(resolution, return_all=False, replace_geometry=False, input_collection=None, output_collection=None)[source]#
Adds the H3 cell to properties.
See https://h3geo.org/ for more details.
Defaults to returning the H3 cell of the centroid of the geometry
If return_all is set to True, will return a list of the H3 that are enclosed by the geometry
Adds a property to the feature properties called “h3_[resolution]” where [resolution] is the level of the H3 cell.
If return_all is set to True, will return a list of the H3 cells that cover the geometry, in a property called “h3_[resolution]_all”.
If replace_geometry is set, the geometry of the feature will be overwritten with the geometry of the H3 cell(s).
- Parameters:
resolution (int) – H3 resolution. Must be between 0 and 15
return_all (bool) – whether to return all H3 cells that cover the geometry. Defaults to False
replace_geometry (bool) – overwrite the geometry of the feature with the H3 cell geometry. Defaults to False.
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 add H3 cell to feature properties
- Return type:
Examples
>>> # Add the H3 cell to the properties of the search response >>> transform = h3(resolution=10)