Distance

The Distance() function returns the geographical distance (in kilometers - as the crow flies) between two points of (latitude,longitude).

This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.

Returns the geographical distance (in kilometers - in a straight line) between two geographical points. Returns Invalid expression if one of the parameter values is not a valid number.

Syntax

Distance(latitude1, longtitude1, latitude2, longtitude2)

Distance(52.349979, 4.894523, 48.858876, 2.293388) => 429.3167582358 (the distance between WEM HQ and the Eifel Tower)

Distance() => Invalid expression

Parameters

NameTypeRequiredDescription

latitude1

numeric

☑️

a geographic coordinate that specifies the north–south position of a point on the Earth's surface in decimal degrees.

longtitude1

numeric

☑️

a geographic coordinate that specifies the east-west position of a point on the Earth's surface decimal degrees.

latitude2

numeric

☑️

a geographic coordinate that specifies the north–south position of a point on the Earth's surface in decimal degrees.

longtitude2

numeric

☑️

a geographic coordinate that specifies the east-west position of a point on the Earth's surface decimal degrees.

Example

Function callResult

Distance(52.370216, 4.895168, -37.814, 14496332)

16545.7337

Last updated