pixcdust.dggs.h3_tools

Functions

h3_to_polygon(h3_index)

get_h3_res_name(→ str)

gdf_to_h3_gdf(→ geopandas.GeoDataFrame)

Convert a GeoDataFrame with latitude and longitude columns to a GeoDataFrame

healpix_to_polygon(healpix, pix)

get_healpix_res_name(→ str)

gdf_to_healpix_gdf(→ geopandas.GeoDataFrame)

Convert a GeoDataFrame with latitude and longitude columns to a GeoDataFrame

Module Contents

pixcdust.dggs.h3_tools.h3_to_polygon(h3_index)[source]
pixcdust.dggs.h3_tools.get_h3_res_name(res: int) str[source]
pixcdust.dggs.h3_tools.gdf_to_h3_gdf(gdf: geopandas.GeoDataFrame, resolution: int) geopandas.GeoDataFrame[source]

Convert a GeoDataFrame with latitude and longitude columns to a GeoDataFrame where rows are aggregated into H3 hexagons based on a given resolution.

Args:

gdf (gpd.GeoDataFrame): The input GeoDataFrame containing ‘latitude’ and ‘longitude’ columns. resolution (int): The H3 resolution level for hexagon indexing.

Returns:
gpd.GeoDataFrame: A new GeoDataFrame where the rows are grouped by H3 hexagons,

containing the mean of the grouped variables, and a geometry column with polygons representing the H3 hexagons.

pixcdust.dggs.h3_tools.healpix_to_polygon(healpix: astropy_healpix.HEALPix, pix: int)[source]
pixcdust.dggs.h3_tools.get_healpix_res_name(res: int) str[source]
pixcdust.dggs.h3_tools.gdf_to_healpix_gdf(gdf: geopandas.GeoDataFrame, resolution: int) geopandas.GeoDataFrame[source]

Convert a GeoDataFrame with latitude and longitude columns to a GeoDataFrame where rows are aggregated into Healpix geometry based on a given resolution.

Args:

gdf (gpd.GeoDataFrame): The input GeoDataFrame containing ‘latitude’ and ‘longitude’ columns. resolution (int): The Healpix resolution level for indexing.

Returns:
gpd.GeoDataFrame: A new GeoDataFrame where the rows are grouped by H3 hexagons,

containing the mean of the grouped variables, and a geometry column with polygons representing the Healpix geometry.