Core
API v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

geodist #

Returns the distance between two geospatial members of a key (see geoadd).

The returned distance is expressed in meters by default.

[Redis documentation]


Query Syntax #

HTTP #

URL: http://kuzzle:7512/ms/_geodist/<_id>/<member1>/<member2>[?unit=[m|km|mi|ft]]
Method: GET

Other protocols #

{
  "controller": "ms",
  "action": "geodist",
  "_id": "<key>",
  "member1": "first member name",
  "member2": "second member name",
  "unit": "ft"
}

Arguments #

  • _id: key containing the geopoints to compare
  • member1: first geopoint name
  • member2: second geopoint name

Optional: #

  • unit: the unit used for the returned calculated distance. Accepted values: m, km, mi, ft

Response #

Returns the calculated distance.

{
  "requestId": "<unique request identifier>",
  "status": 200,
  "error": null,
  "controller": "ms",
  "action": "geodist",
  "collection": null,
  "index": null,
  "result": 192.3
}