GEO.DISTANCE

GEO.DISTANCE calculates the distance (in Km) for the path described as a list of latitude/longitude points. Each point must be a tuple of two floats.

Function category: Geo

Syntax

GEO.DISTANCE(path)

Arguments

Description

path

Collection of geospatial coordinates.

Example

Let's say we know the latitude and longitude values for three cities (Berlin, New York and Tokyo).

# Berlin, Germany
52.520008, 13.404954
# New York, NY, USA
40.730610, -73.935242
# Tokyo, Japan
35.652832, 139.839478

If we want to find the total distance between the three locations (in km) use the following function.

# Find total distance between cities
GEO.DISTANCE({{52.520008, 13.404954}, {40.730610, -73.935242}, {35.652832, 139.839478}})
# Returns 17227.1086650486