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.

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

Name
Type
Required
Description

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 call
Result

Distance(52.370216, 4.895168, -37.814, 14496332)

16545.7337

Last updated

Was this helpful?