Usage
Parameters
The key containing the geospatial index.
The first member to measure from.
The second member to measure to.
The unit of distance to return:
M- Meters (default)KM- KilometersFT- FeetMI- Miles
Response
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