ST_Distance_Sphere — Returns distance between 2 lat/long points. It is the great-circle distance, also known as or orthodromic, which is the shortest distance between any two points on the surface of a sphere measured along a path on the surface of the sphere
double ST_Distance_Sphere(
bytea
PointA, bytea
PointB)
;
Returns distance between 2 lat/long points. It is the great-circle distance, also known as or orthodromic, which is the shortest distance between any two points on the surface of a sphere measured along a path on the surface of the sphere.
Earth radius 6370986.884258304
Distance is calculated by the harvesine formula. See Wikipedia great circle distance for more information.
Where Δσ is the spherical distance, ФS λS are the start point Latitude and Longitude, ФF λF are the final point Latitude and Longitude.
And finally to obtain the linear distance, the next equation is applied (r = Earth radius 6370986.884258304):
This function only works with Points |
2D | 3D | M |
---|---|---|
OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006) | SQL-MM Part 3 |
---|---|---|---|
- | - | - | - |