◷ Reading Time: 1 minute


This extension enables Geo operations.


Calculates the distance between two locations based on latitude and longitude.

 geoDistance (loc1, loc2, unit)
  • loc1, loc2: objects to represent a location based on latitude and longitude. {latitude: value, longitude: value}
    • latitude: value in double
    • longitude: value in double
  • unit: allows defining the result’s unit. The default value is kilometers.
    • k: Kilometers
    • m: Miles
    • n: Nautical Miles
Updated on May 11, 2022

Was this article helpful?

Related Articles