Interface RedisGeoCommands
- All Known Subinterfaces:
DefaultedRedisClusterConnection
,DefaultedRedisConnection
,RedisClusterConnection
,RedisCommands
,RedisConnection
,RedisConnectionUtils.RedisConnectionProxy
,StringRedisConnection
- All Known Implementing Classes:
AbstractRedisConnection
,DefaultStringRedisConnection
,JedisClusterConnection
,JedisConnection
,LettuceClusterConnection
,LettuceConnection
public interface RedisGeoCommands
Geo-specific Redis commands.
- Since:
- 1.8
- Author:
- Ninad Divadkar, Christoph Strobl, Mark Paluch
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Metric
s supported by Redis.static interface
Arguments to be used withRedisGeoCommands
.static class
RedisGeoCommands.GeoLocation
representing aPoint
associated with a name.static class
Additional arguments (like count/sort/...) to be used withRedisGeoCommands
.static class
Additional arguments (like count/sort/...) to be used withRedisGeoCommands
.static class
Additional arguments (like count/sort/...) to be used withRedisGeoCommands
. -
Method Summary
Modifier and TypeMethodDescriptiongeoAdd
(byte[] key, Iterable<RedisGeoCommands.GeoLocation<byte[]>> locations) AddRedisGeoCommands.GeoLocation
s to keyAddMap
of member /Point
pairs to key.geoAdd
(byte[] key, org.springframework.data.geo.Point point, byte[] member) AddPoint
with given member name to key.default Long
geoAdd
(byte[] key, RedisGeoCommands.GeoLocation<byte[]> location) AddRedisGeoCommands.GeoLocation
to key.org.springframework.data.geo.Distance
geoDist
(byte[] key, byte[] member1, byte[] member2) Get theDistance
between member1 and member2.org.springframework.data.geo.Distance
geoDist
(byte[] key, byte[] member1, byte[] member2, org.springframework.data.geo.Metric metric) Get theDistance
between member1 and member2 in the givenMetric
.geoHash
(byte[] key, byte[]... members) Get Geohash representation of the position for one or more members.List<org.springframework.data.geo.Point>
geoPos
(byte[] key, byte[]... members) Get thePoint
representation of positions for one or more members.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadius
(byte[] key, org.springframework.data.geo.Circle within) Get the members within the boundaries of a givenCircle
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadius
(byte[] key, org.springframework.data.geo.Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircle
applyingRedisGeoCommands.GeoRadiusCommandArgs
.default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadiusByMember
(byte[] key, byte[] member, double radius) Get the members within the circle defined by the members coordinates and given radius.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadiusByMember
(byte[] key, byte[] member, org.springframework.data.geo.Distance radius) Get the members within the circle defined by the members coordinates and givenDistance
.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoRadiusByMember
(byte[] key, byte[] member, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates, givenDistance
andRedisGeoCommands.GeoRadiusCommandArgs
.geoRemove
(byte[] key, byte[]... members) Remove the members.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>
geoSearch
(byte[] key, GeoReference<byte[]> reference, GeoShape predicate, RedisGeoCommands.GeoSearchCommandArgs args) Return the members of a geo set which are within the borders of the area specified by a givenshape
.geoSearchStore
(byte[] destKey, byte[] key, GeoReference<byte[]> reference, GeoShape predicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) Query the members of a geo set which are within the borders of the area specified by a givenshape
and store the result atdestKey
.
-
Method Details
-
geoAdd
AddPoint
with given member name to key.- Parameters:
key
- must not be null.point
- must not be null.member
- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- See Also:
-
geoAdd
AddRedisGeoCommands.GeoLocation
to key.- Parameters:
key
- must not be null.location
- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- See Also:
-
geoAdd
@Nullable Long geoAdd(byte[] key, Map<byte[], org.springframework.data.geo.Point> memberCoordinateMap) AddMap
of member /Point
pairs to key.- Parameters:
key
- must not be null.memberCoordinateMap
- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- See Also:
-
geoAdd
AddRedisGeoCommands.GeoLocation
s to key- Parameters:
key
- must not be null.locations
- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- See Also:
-
geoDist
Get theDistance
between member1 and member2.- Parameters:
key
- must not be null.member1
- must not be null.member2
- must not be null.- Returns:
- can be null. null when used in pipeline / transaction.
- See Also:
-
geoDist
@Nullable org.springframework.data.geo.Distance geoDist(byte[] key, byte[] member1, byte[] member2, org.springframework.data.geo.Metric metric) Get theDistance
between member1 and member2 in the givenMetric
.- Parameters:
key
- must not be null.member1
- must not be null.member2
- must not be null.metric
- must not be null.- Returns:
- can be null. null when used in pipeline / transaction.
- See Also:
-
geoHash
Get Geohash representation of the position for one or more members.- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- empty list when key or members do not exists. null when used in pipeline / transaction.
- See Also:
-
geoPos
Get thePoint
representation of positions for one or more members.- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- empty
List
when key of members do not exist. null when used in pipeline / transaction. - See Also:
-
geoRadius
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadius(byte[] key, org.springframework.data.geo.Circle within) Get the members within the boundaries of a givenCircle
.- Parameters:
key
- must not be null.within
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoRadius
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadius(byte[] key, org.springframework.data.geo.Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircle
applyingRedisGeoCommands.GeoRadiusCommandArgs
.- Parameters:
key
- must not be null.within
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoRadiusByMember
@Nullable default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, double radius) Get the members within the circle defined by the members coordinates and given radius.- Parameters:
key
- must not be null.member
- must not be null.radius
-- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoRadiusByMember
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, org.springframework.data.geo.Distance radius) Get the members within the circle defined by the members coordinates and givenDistance
.- Parameters:
key
- must not be null.member
- must not be null.radius
- must not be null.- Returns:
- null when used in pipeline / transaction..
- See Also:
-
geoRadiusByMember
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates, givenDistance
andRedisGeoCommands.GeoRadiusCommandArgs
.- Parameters:
key
- must not be null.member
- must not be null.radius
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- See Also:
-
geoRemove
Remove the members.- Parameters:
key
- must not be null.members
- must not be null.- Returns:
- Number of elements removed. null when used in pipeline / transaction.
- See Also:
-
geoSearch
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoSearch(byte[] key, GeoReference<byte[]> reference, GeoShape predicate, RedisGeoCommands.GeoSearchCommandArgs args) Return the members of a geo set which are within the borders of the area specified by a givenshape
. The query's center point is provided byGeoReference
.- Parameters:
key
- must not be null.reference
- must not be null.predicate
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
geoSearchStore
@Nullable Long geoSearchStore(byte[] destKey, byte[] key, GeoReference<byte[]> reference, GeoShape predicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) Query the members of a geo set which are within the borders of the area specified by a givenshape
and store the result atdestKey
. The query's center point is provided byGeoReference
.- Parameters:
key
- must not be null.reference
- must not be null.predicate
- must not be null.args
- must not be null.- Returns:
- null when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-