CALC_DISTANCE¶
The CALC_DISTANCE function is used to calculate the Euclidean distance between two Point type geographical coordinates.
Syntax¶
Parameters:
point1: The first geographical coordinate of typePoint.point2: The second geographical coordinate of typePoint.
Examples¶
Consider the following table Foo:
With the following data:
Example 1: Calculate the distance between two points¶
Result:
| georesult |
|---|
| 1.104150152832485 |
Errors¶
- If the number of arguments is not 2, a
FunctionArgsLengthNotMatchingerror will be thrown. - If any of the arguments are not of type
Point, aFunctionRequiresPointValueerror will be thrown. - If any of the arguments are
NULL, the result will beNULL.