Geo

◷ Reading Time: 1 minute

FlexRule.Extensions.Geo

This extension enables Geo operations.

geoDistance

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

Example

To see the distance between Paris and Melbourne in kilometers, use the expression below:

Distance = geoDistance ( {“latitude”: -37.8136,”longitude”: 144.9631},
{“latitude”: 48.8566,”longitude”: 2.3522},
“k”)

Updated on February 27, 2026

Was this article helpful?

Related Articles