public class ST_Distance
extends TwoGeoFunction
Determines the distance between two 2D geometries.
Format:
ST_Distance(geometry1 ST_Geometry, geometry2 ST_Geometry, tolerance NUMBER) - return the distance between geometry1 and geometry2
The tolerance at which geometry2 is valid is optional.
By default the tolerance is 0.05 for geodetic geometries and 0 for non geodetic.
For projected data, the distance is in the same unit as the unit of projection. For Geodetic, the distance is in meters.
Return -1 in case of error.
Example:
select ST_Distance(
ST_Point('{ "type": "Point", "coordinates": [0, 0]}', 0),
ST_Point('{ "type": "Point", "coordinates": [6, 8]}', 0)
) from hivetable LIMIT 1; -- return 10.0