daft.functions.great_circle_distance#
great_circle_distance #
great_circle_distance(lat1: Expression, lon1: Expression, lat2: Expression, lon2: Expression) -> Expression
Compute the great circle distance between two points on the Earth.
Invalid inputs including nulls, non-finite values, or out-of-range coordinates (lat ∈ [-90, 90], lon ∈ [-180, 180]) produce null outputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lat1 | Expression | Latitude of the first point in degrees. | required |
lon1 | Expression | Longitude of the first point in degrees. | required |
lat2 | Expression | Latitude of the second point in degrees. | required |
lon2 | Expression | Longitude of the second point in degrees. | required |
Returns:
| Type | Description |
|---|---|
Expression | Great circle distance in meters between the two points. |
Examples:
1 2 3 4 5 | |
Source code in daft/functions/spatial.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |