geodist

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.geodist('key', 'Palermo', 'Catania', function (err, distance) {
  // callback called once the action has completed
});

// Using promises (NodeJS only)
kuzzle.memoryStorage.geodistPromise('key', 'Palermo', 'Catania')
  .then(distance => {
    // resolved once the action has completed
  });
kuzzle.memoryStorage.geodist("key", "Palermo", "Catania", new ResponseListener<double>() {
  @Override
  public void onSuccess(double distance) {
    // callback called once the action has completed
  }

  @Override
  public void onError(JSONObject error) {
  }
});
<?php

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $distance = $kuzzle->memoryStorage()->geodist('key', 'Palermo', 'Catania');
}
catch (ErrorException $e) {

}

Callback response:

166274.1516

Returns the distance between two geospatial members of a key (see geoadd).
The returned distance is expressed in meters by default.

[Redis documentation]


geodist(key, member1, member2, [options], callback)

ArgumentsTypeDescription
keystringKey identifier
member1stringName of the first geospatial point
member2stringName of the second geospatial point
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
queuablebooleanMark this request as (not) queuabletrue
unitstringDistance unit.
Allowed values: m, km, mi, ft
m

Callback response

Resolves to the calculated distance between the two provided geospatial points