dtoolkit.geoaccessor.series.H3.to_points#

H3.to_points() GeoDataFrame[source]#

Return the center Point of H3 cell.

Returns:
GeoDataFrame

With H3 cell as the its index.

Examples

>>> import dtoolkit.geoaccessor
>>> import pandas as pd
>>> s = pd.Series(
...     ['a', 'b'],
...     index=[612845052823076863, 614269156845420543],
...     name='label',
... )
>>> s
612845052823076863    a
614269156845420543    b
Name: label, dtype: object
>>> s.h3.to_points()
                   label                    geometry
612845052823076863     a  POINT (121.99637 55.00331)
614269156845420543     b    POINT (99.99611 0.99919)
>>> df = pd.DataFrame(
...     {'label': ['a', 'b']},
...     index=[612845052823076863, 614269156845420543],
... )
>>> df
                   label
612845052823076863     a
614269156845420543     b
>>> df.h3.to_points()
                   label                    geometry
612845052823076863     a  POINT (121.99637 55.00331)
614269156845420543     b    POINT (99.99611 0.99919)