snowflake.snowpark.functions.h3_cell_to_point¶

snowflake.snowpark.functions.h3_cell_to_point(cell_id: Union[snowflake.snowpark.column.Column, str]) → Column[source]¶

Returns the center point of an H3 cell as a GeoJSON Point object.

Parameters:

cell_id (ColumnOrName) – The H3 cell IDs.

Returns:

GeoJSON Point objects representing the center points of the H3 cells.

Return type:

Column

Example::
>>> import json
>>> df = session.create_dataframe([613036919424548863], schema=["cell_id"])
>>> result = df.select(h3_cell_to_point(df["cell_id"]).alias("POINT")).collect()
>>> assert len(result) == 1
>>> point_json = json.loads(result[0]["POINT"])
>>> assert point_json["type"] == "Point"
>>> assert "coordinates" in point_json
>>> assert len(point_json["coordinates"]) == 2
Copy