DISTANCE

Description

Calculates the distance between two locations in kilometers.

Syntax

DISTANCE(lat1, lon1, lat2, lon2) -> Double

Parameters

ParameterData TypeRequiredDescription
lat1DoubleYesLatitude of the first point.
lon1DoubleYesLongitude of the first location.
lat2DoubleYesLatitude of the second point.
lon2DoubleYesLongitude of the second location.

Example

DISTANCE(40.7128, -74.0060, 51.5074, -0.1278)
-- Returns 5570.222179737957.