dtoolkit.geoaccessor.dataframe.H3#
- class dtoolkit.geoaccessor.dataframe.H3(df: DataFrame, /)[source]#
Hexagonal hierarchical geospatial indexing system.
A little magic binding H3 for
DataFrame.- Attributes:
areaCompute the spherical surface area of a specific H3 cell.
is_pentagonIdentify if H3 cell is a pentagon.
is_res_class_IIIDetermine if cell has orientation “Class II” or “Class III”.
is_validValidates H3 cell (hexagon or pentagon).
resolutionReturn the resolution of H3 cell.
Methods
to_center_child([resolution])Get the center child of cell.
to_children([resolution])Get the children of cell.
to_int()Converts hexadecimal string H3 cell index to 64-bit integer.
to_parent([resolution])Get the parent of cell.
Return the center
Pointof H3 cell.Return
Polygonto describe the cell boundary.to_str()Converts 64-bit integer H3 cell index to hexadecimal string.
- Raises:
- ModuleNotFoundError
If don’t have module named ‘h3’.
- TypeError
If not Index(string) or Index(int64) dtype.
See also
Notes
Based on pandas style, APIs are designed as follows:
Remove the prefix
h3_of the original H3 API. e.g.h3.cell_to_latlng()→to_points()Use
to_prefix for the conversion between H3 cell int and str. e.g.h3.int_to_str()→to_str()Use
is_prefix for the validation of H3 cell. e.g.h3.is_valid_cell()→is_valid()