Programmer Reference : Redis : EsRedisGeoCommands
EsRedisGeoCommands
Description
Provides an API for the Redis Geospatial commands. These commands are used to store and query spatial data, which are longitude-latitude pairs, in sorted sets.
This command group is accessed via EsRedisClient>>geos.
Class Methods
None
Instance Methods
geoadd:longitude:latitude:member:
  Add one geospatial item (latitude, longitude, name) to a sorted set.
    
     Arguments:
        aKey - <String> The key of the geo set.
        lon - <Number> The longitude.
        lat - <Number> The latitude.
        aMember - <Object> The member to add.
     Answers:
        <Integer> The number of elements added to the sorted set.
        <EsFuture> In async mode, a future that completes with the result.
geoadd:options:longitude:latitude:member:
  Add one geospatial item (latitude, longitude, name) to a sorted set with options.
    
     Arguments:
        aKey - <String> The key of the geo set.
        aCollectionOfOptions - <Collection> Optional arguments like NX, XX, CH.
        lon - <Number> The longitude.
        lat - <Number> The latitude.
        aMember - <Object> The member to add.
     Answers:
        <Integer> The number of elements added or updated.
        <EsFuture> In async mode, a future that completes with the result.
geodist:member1:member2:
  Return the distance between two members in a geospatial index.
    
     Arguments:
        aKey - <String> The key of the geo set.
        aMember1 - <Object> The first member.
        aMember2 - <Object> The second member.
     Answers:
        <String> The distance as a string.
        <EsFuture> In async mode, a future that completes with the result.
geodist:member1:member2:unit:
  Return the distance between two members in a geospatial index in the given unit.
    
     Arguments:
        aKey - <String> The key of the geo set.
        aMember1 - <Object> The first member.
        aMember2 - <Object> The second member.
        aUnit - <String> The unit of distance (e.g., 'm', 'km', 'ft', 'mi').
     Answers:
        <String> The distance as a string.
        <EsFuture> In async mode, a future that completes with the result.
geohash:members:
  Return valid Geohash strings representing the position of one or more members.
    
     Arguments:
        aKey - <String> The key of the geo set.
        aCollectionOfMembers - <SequenceableCollection> of <String> The members to get.
     Answers:
        <Array> An array of Geohash strings.
        <EsFuture> In async mode, a future that completes with the result.
geopos:members:
  Return the positions (longitude, latitude) of all the specified members.
    
     Arguments:
        aKey - <String> The key of the geo set.
        aCollectionOfMembers - <SequenceableCollection> of <String> The members to get.
     Answers:
        <Array> An array of positions.
        <EsFuture> In async mode, a future that completes with the result.
georadius:longitude:latitude:radius:unit:
  Query a geospatial index for members within a given radius.
    
     Arguments:
        aKey - <String> The key of the geo set.
        lon - <Number> The longitude.
        lat - <Number> The latitude.
        aRadius - <Number> The radius.
        aUnit - <String> 'm', 'km', 'ft', or 'mi'.
     Answers:
        <Array> An array of members within the radius.
        <EsFuture> In async mode, a future that completes with the result.
georadiusbymember:member:radius:unit:
  Query a geospatial index for members within a given radius of a member.
    
     Arguments:
        aKey - <String> The key of the geo set.
        aMember - <Object> The member.
        aRadius - <Number> The radius.
        aUnit - <String> 'm', 'km', 'ft', or 'mi'.
     Answers:
        <Array> An array of members within the radius.
        <EsFuture> In async mode, a future that completes with the result.
geosearch:from:radius:unit:
  Query a geospatial index for members within a given radius of a member.
    
     Arguments:
        aKey - <String> The key of the geo set.
        aMember - <Object> The member.
        aRadius - <Number> The radius.
        aUnit - <String> 'm', 'km', 'ft', or 'mi'.
     Answers:
        <Array> An array of members within the radius.
        <EsFuture> In async mode, a future that completes with the result.
geosearch:from:radius:unit:options:
  Query a geospatial index for members within a given radius of a member, with options.
    
     Arguments:
        aKey - <String> The key of the geo set.
        aMember - <Object> The member.
        aRadius - <Number> The radius.
        aUnit - <String> 'm', 'km', 'ft', or 'mi'.
        aCollectionOfOptions - <Collection> Optional arguments like WITHCOORD, WITHDIST, WITHHASH, COUNT, ASC, DESC.
     Answers:
        <Array> An array of members within the radius, with optional data.
        <EsFuture> In async mode, a future that completes with the result.
geosearch:fromLon:lat:byBoxWidth:height:unit:options:
  Query a geospatial index for members within a box, with options.
    
     Arguments:
        aKey - <String> The key of the geo set.
        lon - <Number> The longitude of the center.
        lat - <Number> The latitude of the center.
        width - <Number> The width of the box.
        height - <Number> The height of the box.
        aUnit - <String> 'm', 'km', 'ft', or 'mi'.
        aCollectionOfOptions - <Collection> Optional arguments like WITHCOORD, WITHDIST, WITHHASH, COUNT, ASC, DESC.
     Answers:
        <Array> An array of members within the box, with optional data.
        <EsFuture> In async mode, a future that completes with the result.
geosearchstore:sourceKey:from:radius:unit:
  Query a geospatial index and store the result.
    
     Arguments:
        aDestKey - <String> The destination key.
        aSourceKey - <String> The source key.
        aMember - <Object> The member.
        aRadius - <Number> The radius.
        aUnit - <String> 'm', 'km', 'ft', or 'mi'.
     Answers:
        <Integer> The number of elements in the stored set.
        <EsFuture> In async mode, a future that completes with the result.
geosearchstore:sourceKey:from:radius:unit:options:
  Query a geospatial index and store the result.
    
     Arguments:
        aDestKey - <String> The destination key.
        aSourceKey - <String> The source key.
        aMember - <Object> The member.
        aRadius - <Number> The radius.
        aUnit - <String> 'm', 'km', 'ft', or 'mi'.
        aCollectionOfOptions - <Collection> Optional arguments like COUNT.
     Answers:
        <Integer> The number of elements in the stored set.
        <EsFuture> In async mode, a future that completes with the result.
geosearchstore:sourceKey:fromLon:lat:byBoxWidth:height:unit:options:
  Query a geospatial index by box and store the result.
    
     Arguments:
        aDestKey - <String> The destination key.
        aSourceKey - <String> The source key.
        lon - <Number> The longitude of the center.
        lat - <Number> The latitude of the center.
        width - <Number> The width of the box.
        height - <Number> The height of the box.
        aUnit - <String> 'm', 'km', 'ft', or 'mi'.
        aCollectionOfOptions - <Collection> Optional arguments like COUNT.
     Answers:
        <Integer> The number of elements in the stored set.
        <EsFuture> In async mode, a future that completes with the result.
Last modified date: 01/22/2026