tobler.util.util¶
Useful functions to support tobler’s interpolation methods.
Module Contents¶
Functions¶
Generate a hexgrid geodataframe that covers the face of a source geodataframe. |
|
Find the circumradius of an h3 hexagon at given resolution. |
API¶
- tobler.util.util.h3fy(source, resolution=6, clip=False, buffer=False, return_geoms=True)[source]¶
Generate a hexgrid geodataframe that covers the face of a source geodataframe.
Parameters
source : geopandas.GeoDataFrame GeoDataFrame to transform into a hexagonal grid resolution : int, optional (default is 6) resolution of output h3 hexgrid. See https://h3geo.org/docs/core-library/restable for more information clip : bool, optional (default is False) if True, hexagons are clipped by the boundary of the source gdf. Otherwise, heaxgons along the boundary will be left intact. buffer : bool, optional (default is False) if True, force hexagons to completely fill the interior of the source area. if False, (h3 default) may result in empty areas within the source area. return_geoms: bool, optional (default is True) whether to generate hexagon geometries as a geodataframe or simply return hex ids as a pandas.Series
Returns
pandas.Series or geopandas.GeoDataFrame if
return_geomsis True, a geopandas.GeoDataFrame whose rows comprise a hexagonal h3 grid (indexed on h3 hex id). ifreturn_geomsis False, a pandas.Series of h3 hexagon ids