snowflake.snowpark.functions.haversine¶
- snowflake.snowpark.functions.haversine(lat1: Union[snowflake.snowpark.column.Column, str], lon1: Union[snowflake.snowpark.column.Column, str], lat2: Union[snowflake.snowpark.column.Column, str], lon2: Union[snowflake.snowpark.column.Column, str]) Column[source]¶
Calculates the great circle distance in kilometers between two points on Earth using the Haversine formula.
- Parameters:
lat1 (ColumnOrName) – The latitude of the first point in degrees.
lon1 (ColumnOrName) – The longitude of the first point in degrees.
lat2 (ColumnOrName) – The latitude of the second point in degrees.
lon2 (ColumnOrName) – The longitude of the second point in degrees.
- Returns:
The distance in kilometers between the two points.
- Return type:
Example: