Skip to main content

Usage

Parameters

key
string
required
The key containing the geospatial index.
member1
string
required
The first member to measure from.
member2
string
required
The second member to measure to.
unit
'M' | 'KM' | 'FT' | 'MI'
default:"M"
The unit of distance to return:
  • M - Meters (default)
  • KM - Kilometers
  • FT - Feet
  • MI - Miles

Response

result
number | null
The distance between the two members in the specified unit.Returns null if one or both members do not exist.

Examples

Get distance in different units

Handle missing members

Calculate multiple distances

Important Notes

Distance Calculation

  • Distances are calculated using the Haversine formula
  • The Earth is assumed to be a perfect sphere
  • Results are approximations and may differ slightly from other geospatial systems
  • The precision of the distance depends on the precision of the stored coordinates

Unit Conversions