Skip to main content

Usage

Parameters

key
string
required
The key containing the geospatial index.
members
string | string[]
required
One or more members to get the position for. Can be passed as individual arguments or as an array.

Response

result
Coordinates[]
An array of coordinate objects in the same order as the requested members.Members that do not exist are omitted from the result array.

Examples

Get position for a single member

Get positions for multiple members

Handle missing members

Using array syntax

Verify coordinates after adding

Important Notes

Coordinate Precision

The returned coordinates may have slight variations from the original values due to:
  • Internal encoding using a 52-bit Geohash
  • Conversion between Geohash and coordinates
  • Floating-point arithmetic
Typically, the precision loss is very small (within a few meters).

Return Format

  • The SDK returns coordinates as objects with lng and lat properties
  • Missing members are omitted from the results array (not returned as null)
  • The result array may be shorter than the input array if some members don’t exist

Coordinate Order

While geoadd uses longitude and latitude property names, geopos returns lng and lat: