Interface GeoOperations<K,M>
public interface GeoOperations<K,M>
Redis operations for geo commands.
- Since:
- 1.8
- Author:
- Ninad Divadkar, Christoph Strobl, Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionadd(K key, Iterable<RedisGeoCommands.GeoLocation<M>> locations) AddRedisGeoCommands.GeoLocations to keyAddMapof member /Pointpairs to key.AddPointwith given member name to key.add(K key, RedisGeoCommands.GeoLocation<M> location) AddRedisGeoCommands.GeoLocationto key.org.springframework.data.geo.DistanceGet theDistancebetween member1 and member2.org.springframework.data.geo.DistanceGet theDistancebetween member1 and member2 in the givenMetric.Get Geohash representation of the position for one or more members.List<org.springframework.data.geo.Point>Get thePointrepresentation of positions for one or more members.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>Get the members within the circle defined by the members coordinates and given radius.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>Get the members within the circle defined by the members coordinates and given radius applyingMetric.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>radius(K key, M member, org.springframework.data.geo.Distance distance, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates and given radius applyingMetricandRedisGeoCommands.GeoRadiusCommandArgs.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>Get the members within the boundaries of a givenCircle.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>radius(K key, org.springframework.data.geo.Circle within, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the boundaries of a givenCircleapplyingRedisGeoCommands.GeoRadiusCommandArgs.Remove the members.default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>Get the members within the boundaries of a givenCircle.default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>search(K key, GeoReference<M> reference, org.springframework.data.geo.Distance radius) Get the members usingGeoReferenceas center of the query within the boundaries of a givenradius.default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>search(K key, GeoReference<M> reference, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoSearchCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a givenradiusapplyingRedisGeoCommands.GeoRadiusCommandArgs.default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>search(K key, GeoReference<M> reference, BoundingBox boundingBox) Get the members usingGeoReferenceas center of the query within the boundaries of a given bounding box.default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>search(K key, GeoReference<M> reference, BoundingBox boundingBox, RedisGeoCommands.GeoSearchCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a given bounding box applyingRedisGeoCommands.GeoRadiusCommandArgs.org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>>search(K key, GeoReference<M> reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a givenpredicateapplyingRedisGeoCommands.GeoRadiusCommandArgs.default LongsearchAndStore(K key, K destKey, org.springframework.data.geo.Circle within) Get the members within the boundaries of a givenCircleand store results atdestKey.default LongsearchAndStore(K key, K destKey, GeoReference<M> reference, org.springframework.data.geo.Distance radius) Get the members usingGeoReferenceas center of the query within the boundaries of a givenradiusand store results atdestKey.default LongsearchAndStore(K key, K destKey, GeoReference<M> reference, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoSearchStoreCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a givenradiusapplyingRedisGeoCommands.GeoRadiusCommandArgsand store results atdestKey.default LongsearchAndStore(K key, K destKey, GeoReference<M> reference, BoundingBox boundingBox) Get the members usingGeoReferenceas center of the query within the boundaries of a given bounding box and store results atdestKey.default LongsearchAndStore(K key, K destKey, GeoReference<M> reference, BoundingBox boundingBox, RedisGeoCommands.GeoSearchStoreCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a given bounding box applyingRedisGeoCommands.GeoRadiusCommandArgsand store results atdestKey.searchAndStore(K key, K destKey, GeoReference<M> reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a givenpredicateapplyingRedisGeoCommands.GeoRadiusCommandArgsand store results atdestKey.
-
Method Details
-
add
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.
- Since:
- 2.0
- See Also:
-
add
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.
- Since:
- 2.0
- See Also:
-
add
AddMapof member /Pointpairs to key.- Parameters:
key- must not be null.memberCoordinateMap- must not be null.- Returns:
- Number of elements added. null when used in pipeline / transaction.
- Since:
- 2.0
- See Also:
-
add
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.
- Since:
- 2.0
- See Also:
-
distance
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.
- Since:
- 2.0
- See Also:
-
distance
@Nullable org.springframework.data.geo.Distance distance(K key, M member1, M member2, org.springframework.data.geo.Metric metric) Get theDistancebetween 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.
- Since:
- 2.0
- See Also:
-
hash
Get Geohash representation of the position for one or more members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.0
- See Also:
-
position
Get thePointrepresentation of positions for one or more members.- Parameters:
key- must not be null.members- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.0
- See Also:
-
radius
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> radius(K 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:
- never null unless used in pipeline / transaction.
- Since:
- 2.0
- See Also:
-
radius
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> radius(K key, org.springframework.data.geo.Circle within, 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:
- never null unless used in pipeline / transaction.
- Since:
- 2.0
- See Also:
-
radius
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> radius(K key, M 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:
- never null unless used in pipeline / transaction.
- Since:
- 2.0
- See Also:
-
radius
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> radius(K key, M member, org.springframework.data.geo.Distance distance) Get the members within the circle defined by the members coordinates and given radius applyingMetric.- Parameters:
key- must not be null.member- must not be null.distance- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.0
- See Also:
-
radius
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> radius(K key, M member, org.springframework.data.geo.Distance distance, RedisGeoCommands.GeoRadiusCommandArgs args) Get the members within the circle defined by the members coordinates and given radius applyingMetricandRedisGeoCommands.GeoRadiusCommandArgs.- Parameters:
key- must not be null.member- must not be null.distance- must not be null.args- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.0
- See Also:
-
remove
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.
- Since:
- 2.0
-
search
@Nullable default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> search(K 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:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
search
@Nullable default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> search(K key, GeoReference<M> reference, org.springframework.data.geo.Distance radius) Get the members usingGeoReferenceas center of the query within the boundaries of a givenradius.- Parameters:
key- must not be null.reference- must not be null.radius- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
search
@Nullable default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> search(K key, GeoReference<M> reference, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoSearchCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a givenradiusapplyingRedisGeoCommands.GeoRadiusCommandArgs.- Parameters:
key- must not be null.reference- must not be null.radius- must not be null.args- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
search
@Nullable default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> search(K key, GeoReference<M> reference, BoundingBox boundingBox) Get the members usingGeoReferenceas center of the query within the boundaries of a given bounding box.- Parameters:
key- must not be null.reference- must not be null.boundingBox- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
search
@Nullable default org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> search(K key, GeoReference<M> reference, BoundingBox boundingBox, RedisGeoCommands.GeoSearchCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a given bounding box applyingRedisGeoCommands.GeoRadiusCommandArgs.- Parameters:
key- must not be null.reference- must not be null.boundingBox- must not be null.args- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
search
@Nullable org.springframework.data.geo.GeoResults<RedisGeoCommands.GeoLocation<M>> search(K key, GeoReference<M> reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a givenpredicateapplyingRedisGeoCommands.GeoRadiusCommandArgs.- Parameters:
key- must not be null.reference- must not be null.geoPredicate- must not be null.args- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
searchAndStore
Get the members within the boundaries of a givenCircleand store results atdestKey.- Parameters:
key- must not be null.within- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
searchAndStore
@Nullable default Long searchAndStore(K key, K destKey, GeoReference<M> reference, org.springframework.data.geo.Distance radius) Get the members usingGeoReferenceas center of the query within the boundaries of a givenradiusand store results atdestKey.- Parameters:
key- must not be null.reference- must not be null.radius- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
searchAndStore
@Nullable default Long searchAndStore(K key, K destKey, GeoReference<M> reference, org.springframework.data.geo.Distance radius, RedisGeoCommands.GeoSearchStoreCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a givenradiusapplyingRedisGeoCommands.GeoRadiusCommandArgsand store results atdestKey.- Parameters:
key- must not be null.reference- must not be null.radius- must not be null.args- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
searchAndStore
@Nullable default Long searchAndStore(K key, K destKey, GeoReference<M> reference, BoundingBox boundingBox) Get the members usingGeoReferenceas center of the query within the boundaries of a given bounding box and store results atdestKey.- Parameters:
key- must not be null.reference- must not be null.boundingBox- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
searchAndStore
@Nullable default Long searchAndStore(K key, K destKey, GeoReference<M> reference, BoundingBox boundingBox, RedisGeoCommands.GeoSearchStoreCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a given bounding box applyingRedisGeoCommands.GeoRadiusCommandArgsand store results atdestKey.- Parameters:
key- must not be null.reference- must not be null.boundingBox- must not be null.args- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
searchAndStore
@Nullable Long searchAndStore(K key, K destKey, GeoReference<M> reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchStoreCommandArgs args) Get the members usingGeoReferenceas center of the query within the boundaries of a givenpredicateapplyingRedisGeoCommands.GeoRadiusCommandArgsand store results atdestKey.- Parameters:
key- must not be null.reference- must not be null.geoPredicate- must not be null.args- must not be null.- Returns:
- never null unless used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-