Interface RedisGeoCommands
- All Known Subinterfaces:
DefaultedRedisClusterConnection,DefaultedRedisConnection,RedisClusterConnection,RedisCommands,RedisConnection,RedisConnectionUtils.RedisConnectionProxy,StringRedisConnection
- All Known Implementing Classes:
AbstractRedisConnection,DefaultStringRedisConnection,JedisClusterConnection,JedisConnection,LettuceClusterConnection,LettuceConnection
@NullUnmarked
public interface RedisGeoCommands
Geo-specific Redis commands.
- Since:
- 1.8
- Author:
- Ninad Divadkar, Christoph Strobl, Mark Paluch
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumMetrics supported by Redis.static interfaceArguments to be used withRedisGeoCommands.static classRedisGeoCommands.GeoLocationrepresenting aPointassociated with a name.static classAdditional arguments (like count/sort/...) to be used withRedisGeoCommands.static classAdditional arguments (like count/sort/...) to be used withRedisGeoCommands.static classAdditional arguments (like count/sort/...) to be used withRedisGeoCommands. -
Method Summary
Modifier and TypeMethodDescriptiongeoAdd(byte @NonNull [] key, @NonNull Iterable<@NonNull RedisGeoCommands.GeoLocation<byte[]>> locations) AddRedisGeoCommands.GeoLocations to keyAddPointwith given member name to key.default LonggeoAdd(byte @NonNull [] key, @NonNull RedisGeoCommands.GeoLocation<byte[]> location) AddRedisGeoCommands.GeoLocationto key.geoDist(byte @NonNull [] key, byte @NonNull [] member1, byte @NonNull [] member2) Get theDistancebetween member1 and member2.geoDist(byte @NonNull [] key, byte @NonNull [] member1, byte @NonNull [] member2, @NonNull Metric metric) geoHash(byte @NonNull [] key, byte @NonNull [] @NonNull ... members) Get Geohash representation of the position for one or more members.geoPos(byte @NonNull [] key, byte @NonNull [] @NonNull ... members) Get thePointrepresentation of positions for one or more members.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>Get the members within the boundaries of a givenCircle.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>geoRadius(byte @NonNull [] key, @NonNull Circle within, @NonNull RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircleapplyingRedisGeoCommands.GeoRadiusCommandArgs.default GeoResults<RedisGeoCommands.GeoLocation<byte[]>>geoRadiusByMember(byte @NonNull [] key, byte @NonNull [] member, double radius) Get the members within the circle defined by the members coordinates and given radius.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>geoRadiusByMember(byte @NonNull [] key, byte @NonNull [] member, @NonNull Distance radius) Get the members within the circle defined by the members coordinates and givenDistance.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>geoRadiusByMember(byte @NonNull [] key, byte @NonNull [] member, @NonNull Distance radius, @NonNull RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates, givenDistanceandRedisGeoCommands.GeoRadiusCommandArgs.geoRemove(byte @NonNull [] key, byte @NonNull [] @NonNull ... members) Remove the members.GeoResults<RedisGeoCommands.GeoLocation<byte[]>>geoSearch(byte @NonNull [] key, @NonNull GeoReference<byte[]> reference, @NonNull GeoShape predicate, @NonNull RedisGeoCommands.GeoSearchCommandArgs args) Return the members of a geo set which are within the borders of the area specified by a givenshape.geoSearchStore(byte @NonNull [] destKey, byte @NonNull [] key, @NonNull GeoReference<byte[]> reference, @NonNull GeoShape predicate, @NonNull RedisGeoCommands.GeoSearchStoreCommandArgs args) Query the members of a geo set which are within the borders of the area specified by a givenshapeand store the result atdestKey.
-
Method Details
-
geoAdd
AddPointwith 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.GeoLocationto 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
Long geoAdd(byte @NonNull [] key, @NonNull Map<byte @NonNull [], @NonNull Point> memberCoordinateMap) - 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
Long geoAdd(byte @NonNull [] key, @NonNull Iterable<@NonNull RedisGeoCommands.GeoLocation<byte[]>> locations) AddRedisGeoCommands.GeoLocations 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 theDistancebetween 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
Distance geoDist(byte @NonNull [] key, byte @NonNull [] member1, byte @NonNull [] member2, @NonNull Metric metric) - 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 thePointrepresentation of positions for one or more members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- empty
Listwhen key of members do not exist. null when used in pipeline / transaction. - See Also:
-
geoRadius
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadius(byte @NonNull [] key, @NonNull 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
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadius(byte @NonNull [] key, @NonNull Circle within, @NonNull RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircleapplyingRedisGeoCommands.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
default GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte @NonNull [] key, byte @NonNull [] 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
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte @NonNull [] key, byte @NonNull [] member, @NonNull 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
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte @NonNull [] key, byte @NonNull [] member, @NonNull Distance radius, @NonNull RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates, givenDistanceandRedisGeoCommands.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
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoSearch(byte @NonNull [] key, @NonNull GeoReference<byte[]> reference, @NonNull GeoShape predicate, @NonNull 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
Long geoSearchStore(byte @NonNull [] destKey, byte @NonNull [] key, @NonNull GeoReference<byte[]> reference, @NonNull GeoShape predicate, @NonNull RedisGeoCommands.GeoSearchStoreCommandArgs args) Query the members of a geo set which are within the borders of the area specified by a givenshapeand 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:
-