dtoolkit.geoaccessor.series.H3#

class dtoolkit.geoaccessor.series.H3(s: Series, /)[source]#

Hexagonal hierarchical geospatial indexing system.

A little magic binding H3 for Series.

Raises
ModuleNotFoundError

If don’t have module named ‘h3’.

TypeError

If not Index(string) or Index(int64) dtype.

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()

Attributes
area

Compute the spherical surface area of a specific H3 cell.

is_pentagon

Identify if H3 cell is a pentagon.

is_res_class_III

Determine if cell has orientation “Class II” or “Class III”.

is_valid

Validates H3 cell (hexagon or pentagon).

resolution

Return 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.

to_points()

Return the center Point of H3 cell.

to_polygons()

Return Polygon to describe the cell boundary.

to_str()

Converts 64-bit integer H3 cell index to hexadecimal string.