public interface GeoCommands
Modifier and Type | Method and Description |
---|---|
long |
geoadd(java.lang.String key,
double longitude,
double latitude,
java.lang.String member)
Adds the specified geospatial item (longitude, latitude, member) to the specified key.
|
long |
geoadd(java.lang.String key,
GeoAddParams params,
java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
Adds the specified geospatial items (in memberCoordinateMap) to the specified key.
|
long |
geoadd(java.lang.String key,
java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
Adds the specified geospatial items (in memberCoordinateMap) to the specified key.
|
java.lang.Double |
geodist(java.lang.String key,
java.lang.String member1,
java.lang.String member2)
Return the distance between two members in the geospatial index represented by the sorted set.
|
java.lang.Double |
geodist(java.lang.String key,
java.lang.String member1,
java.lang.String member2,
GeoUnit unit)
Return the distance between two members in the geospatial index represented by the sorted set.
|
java.util.List<java.lang.String> |
geohash(java.lang.String key,
java.lang.String... members)
Return valid Geohash strings representing the position of the given members.
|
java.util.List<GeoCoordinate> |
geopos(java.lang.String key,
java.lang.String... members)
Return the positions (longitude,latitude) of all the specified members.
|
java.util.List<GeoRadiusResponse> |
georadius(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified with the center location and the radius.
|
java.util.List<GeoRadiusResponse> |
georadius(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified with the center location and the radius.
|
java.util.List<GeoRadiusResponse> |
georadiusByMember(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit)
This command is exactly like
GEORADIUS
with the sole difference that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing inside the geospatial index
represented by the sorted set. |
java.util.List<GeoRadiusResponse> |
georadiusByMember(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param)
This command is exactly like
GEORADIUS
with the sole difference that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing inside the geospatial index
represented by the sorted set. |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit)
Readonly version of
GEORADIUSBYMEMBER |
java.util.List<GeoRadiusResponse> |
georadiusByMemberReadonly(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param)
Readonly version of
GEORADIUSBYMEMBER |
long |
georadiusByMemberStore(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam)
This command is exactly like
GEORADIUSBYMEMBER
but storing the results at the destination key (provided with storeParam ). |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit)
Readonly version of
GEORADIUS , |
java.util.List<GeoRadiusResponse> |
georadiusReadonly(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param)
Readonly version of
GEORADIUS , |
long |
georadiusStore(java.lang.String key,
double longitude,
double latitude,
double radius,
GeoUnit unit,
GeoRadiusParam param,
GeoRadiusStoreParam storeParam)
This command is exactly like
GEORADIUS
but storing the results at the destination key (provided with storeParam ). |
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
GeoCoordinate coord,
double width,
double height,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
GeoCoordinate coord,
double radius,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
GeoSearchParam params)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
java.lang.String member,
double width,
double height,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
java.util.List<GeoRadiusResponse> |
geosearch(java.lang.String key,
java.lang.String member,
double radius,
GeoUnit unit)
Return the members of a sorted set populated with geospatial information using GEOADD,
which are within the borders of the area specified by a given shape.
|
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
GeoCoordinate coord,
double width,
double height,
GeoUnit unit)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
GeoCoordinate coord,
double radius,
GeoUnit unit)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
GeoSearchParam params)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
java.lang.String member,
double width,
double height,
GeoUnit unit)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStore(java.lang.String dest,
java.lang.String src,
java.lang.String member,
double radius,
GeoUnit unit)
This command is exactly like
GEOSEARCH
but storing the results at dest. |
long |
geosearchStoreStoreDist(java.lang.String dest,
java.lang.String src,
GeoSearchParam params)
This command is exactly like
GEOSEARCHSTORE
but storing the results with their destinations from the center point. |
long geoadd(java.lang.String key, double longitude, double latitude, java.lang.String member)
Time complexity: O(log(N)) where N is the number of elements in the sorted set.
key
- longitude
- latitude
- member
- long geoadd(java.lang.String key, java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
Time complexity: O(log(N)) for each item added, where N is the number of elements in the sorted set.
key
- memberCoordinateMap
- Members names with their geo coordinateslong geoadd(java.lang.String key, GeoAddParams params, java.util.Map<java.lang.String,GeoCoordinate> memberCoordinateMap)
Time complexity: O(log(N)) for each item added
key
- params
- Additional optionsmemberCoordinateMap
- Members names with their geo coordinatesjava.lang.Double geodist(java.lang.String key, java.lang.String member1, java.lang.String member2)
Time complexity: O(log(N))
key
- member1
- member2
- java.lang.Double geodist(java.lang.String key, java.lang.String member1, java.lang.String member2, GeoUnit unit)
Time complexity: O(log(N))
key
- member1
- member2
- unit
- can be M, KM, MI or FT can M, KM, MI or FTjava.util.List<java.lang.String> geohash(java.lang.String key, java.lang.String... members)
Time complexity: O(log(N)) for each member requested
key
- members
- java.util.List<GeoCoordinate> geopos(java.lang.String key, java.lang.String... members)
Time complexity: O(N) where N is the number of members requested.
key
- members
- java.util.List<GeoRadiusResponse> georadius(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit)
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTjava.util.List<GeoRadiusResponse> georadiusReadonly(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit)
GEORADIUS
,
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTgeoradius(String, double, double, double, GeoUnit)
java.util.List<GeoRadiusResponse> georadius(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
GeoRadiusParam
:
WITHDIST: Also return the distance of the returned items from the specified center.
The distance is returned in the same unit as the unit specified as the radius argument of the command.
WITHCOORD: Also return the longitude,latitude coordinates of the matching items.
WITHHASH: Also return the raw geohash-encoded sorted set score of the item, in the form of a 52
bit unsigned integer. This is only useful for low level hacks or debugging and is otherwise of
little interest for the general user.
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
java.util.List<GeoRadiusResponse> georadiusReadonly(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param)
GEORADIUS
,
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
georadius(String, double, double, double, GeoUnit, GeoRadiusParam)
java.util.List<GeoRadiusResponse> georadiusByMember(java.lang.String key, java.lang.String member, double radius, GeoUnit unit)
GEORADIUS
with the sole difference that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing inside the geospatial index
represented by the sorted set.
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTjava.util.List<GeoRadiusResponse> georadiusByMemberReadonly(java.lang.String key, java.lang.String member, double radius, GeoUnit unit)
GEORADIUSBYMEMBER
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTjava.util.List<GeoRadiusResponse> georadiusByMember(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param)
GEORADIUS
with the sole difference that instead of taking, as the center of the area to query, a longitude
and latitude value, it takes the name of a member already existing inside the geospatial index
represented by the sorted set.
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
java.util.List<GeoRadiusResponse> georadiusByMemberReadonly(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param)
GEORADIUSBYMEMBER
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
long georadiusStore(java.lang.String key, double longitude, double latitude, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
GEORADIUS
but storing the results at the destination key (provided with storeParam
).
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- longitude
- of the center pointlatitude
- of the center pointradius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
storeParam
- GeoRadiusStoreParam
long georadiusByMemberStore(java.lang.String key, java.lang.String member, double radius, GeoUnit unit, GeoRadiusParam param, GeoRadiusStoreParam storeParam)
GEORADIUSBYMEMBER
but storing the results at the destination key (provided with storeParam
).
Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
key
- member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTparam
- GeoRadiusParam
storeParam
- GeoRadiusStoreParam
java.util.List<GeoRadiusResponse> geosearch(java.lang.String key, java.lang.String member, double radius, GeoUnit unit)
This command can be used in place of the GEORADIUSBYMEMBER
command.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
key
- member
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTjava.util.List<GeoRadiusResponse> geosearch(java.lang.String key, GeoCoordinate coord, double radius, GeoUnit unit)
This command can be used in place of the GEORADIUS
command.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
key
- coord
- represents the center of the arearadius
- of the areaunit
- can be M, KM, MI or FTjava.util.List<GeoRadiusResponse> geosearch(java.lang.String key, java.lang.String member, double width, double height, GeoUnit unit)
The axis-aligned rectangle, determined by height and width, when the center point is determined by the position of the given member.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
key
- member
- represents the center of the areawidth
- of the rectangular areaheight
- of the rectangular areaunit
- can be M, KM, MI or FTjava.util.List<GeoRadiusResponse> geosearch(java.lang.String key, GeoCoordinate coord, double width, double height, GeoUnit unit)
The axis-aligned rectangle, determined by height and width, when the center point is determined by the given coordinate.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
key
- coord
- represents the center pointwidth
- of the rectangular areaheight
- of the rectangular areaunit
- can be M, KM, MI or FTjava.util.List<GeoRadiusResponse> geosearch(java.lang.String key, GeoSearchParam params)
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
key
- params
- GeoSearchParam
long geosearchStore(java.lang.String dest, java.lang.String src, java.lang.String member, double radius, GeoUnit unit)
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
dest
- src
- the sorted set (key)member
- represents the center of the arearadius
- of the circular areaunit
- can be M, KM, MI or FTlong geosearchStore(java.lang.String dest, java.lang.String src, GeoCoordinate coord, double radius, GeoUnit unit)
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
dest
- src
- coord
- represents the center pointradius
- of the circular areaunit
- can be M, KM, MI or FTlong geosearchStore(java.lang.String dest, java.lang.String src, java.lang.String member, double width, double height, GeoUnit unit)
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
dest
- src
- member
- represents the center of the areawidth
- of the rectangular areaheight
- of the rectangular areaunit
- can be M, KM, MI or FTlong geosearchStore(java.lang.String dest, java.lang.String src, GeoCoordinate coord, double width, double height, GeoUnit unit)
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
dest
- src
- coord
- represents the center pointwidth
- of the rectangular areaheight
- of the rectangular areaunit
- can be M, KM, MI or FTlong geosearchStore(java.lang.String dest, java.lang.String src, GeoSearchParam params)
GEOSEARCH
but storing the results at dest.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
dest
- src
- params
- GeoSearchParam
long geosearchStoreStoreDist(java.lang.String dest, java.lang.String src, GeoSearchParam params)
GEOSEARCHSTORE
but storing the results with their destinations from the center point.
Time complexity: O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape
dest
- src
- params
- GeoSearchParam
Copyright © 2024. All rights reserved.