snowflake.snowpark.functions.h3_latlng_to_cell¶
- snowflake.snowpark.functions.h3_latlng_to_cell(latitude: Union[snowflake.snowpark.column.Column, str], longitude: Union[snowflake.snowpark.column.Column, str], target_resolution: Union[snowflake.snowpark.column.Column, str]) Column [source]¶
Returns the H3 cell ID for the given latitude, longitude, and resolution.
- Parameters:
latitude (ColumnOrName) – The latitude values.
longitude (ColumnOrName) – The longitude values.
target_resolution (ColumnOrName) – The target H3 resolution.
- Returns:
H3 cell ID for the given latitude, longitude, and resolution.
- Return type:
Example:
>>> df = session.create_dataframe([[52.516262, 13.377704, 8]], schema=["lat", "lng", "res"]) >>> df.select(h3_latlng_to_cell(df["lat"], df["lng"], df["res"])).collect() [Row(H3_LATLNG_TO_CELL("LAT", "LNG", "RES")=613036919424548863)]