# Interface GeoOperations<K,M>

public interface GeoOperations<K,M>
Redis operations for geo commands.
Since:
1.8
Author:
• ## Method Summary

Modifier and Type
Method
Description
`Long`
```add(K key, Iterable<RedisGeoCommands.GeoLocation<M>> locations)```
`Long`
```add(K key, Map<M,Point> memberCoordinateMap)```
Add `Map` of member / `Point` pairs to key.
`Long`
```add(K key, Point point, M member)```
Add `Point` with given member name to key.
`Long`
```add(K key, RedisGeoCommands.GeoLocation<M> location)```
`Distance`
```distance(K key, M member1, M member2)```
Get the `Distance` between member1 and member2.
`Distance`
```distance(K key, M member1, M member2, Metric metric)```
Get the `Distance` between member1 and member2 in the given `Metric`.
`List<String>`
```hash(K key, M... members)```
Get Geohash representation of the position for one or more members.
`List<Point>`
```position(K key, M... members)```
Get the `Point` representation of positions for one or more members.
`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.
`GeoResults<RedisGeoCommands.GeoLocation<M>>`
```radius(K key, M member, Distance distance)```
Get the members within the circle defined by the members coordinates and given radius applying `Metric`.
`GeoResults<RedisGeoCommands.GeoLocation<M>>`
```radius(K key, M member, Distance distance, RedisGeoCommands.GeoRadiusCommandArgs args)```
Get the members within the circle defined by the members coordinates and given radius applying `Metric` and `RedisGeoCommands.GeoRadiusCommandArgs`.
`GeoResults<RedisGeoCommands.GeoLocation<M>>`
```radius(K key, Circle within)```
Get the members within the boundaries of a given `Circle`.
`GeoResults<RedisGeoCommands.GeoLocation<M>>`
```radius(K key, Circle within, RedisGeoCommands.GeoRadiusCommandArgs args)```
Get the members within the boundaries of a given `Circle` applying `RedisGeoCommands.GeoRadiusCommandArgs`.
`Long`
```remove(K key, M... members)```
Remove the members.
`default GeoResults<RedisGeoCommands.GeoLocation<M>>`
```search(K key, Circle within)```
Get the members within the boundaries of a given `Circle`.
`default GeoResults<RedisGeoCommands.GeoLocation<M>>`
```search(K key, GeoReference<M> reference, Distance radius)```
Get the members using `GeoReference` as center of the query within the boundaries of a given `radius`.
`default GeoResults<RedisGeoCommands.GeoLocation<M>>`
```search(K key, GeoReference<M> reference, Distance radius, RedisGeoCommands.GeoSearchCommandArgs args)```
Get the members using `GeoReference` as center of the query within the boundaries of a given `radius` applying `RedisGeoCommands.GeoRadiusCommandArgs`.
`default GeoResults<RedisGeoCommands.GeoLocation<M>>`
```search(K key, GeoReference<M> reference, BoundingBox boundingBox)```
Get the members using `GeoReference` as center of the query within the boundaries of a given bounding box.
`default GeoResults<RedisGeoCommands.GeoLocation<M>>`
```search(K key, GeoReference<M> reference, BoundingBox boundingBox, RedisGeoCommands.GeoSearchCommandArgs args)```
Get the members using `GeoReference` as center of the query within the boundaries of a given bounding box applying `RedisGeoCommands.GeoRadiusCommandArgs`.
`GeoResults<RedisGeoCommands.GeoLocation<M>>`
```search(K key, GeoReference<M> reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchCommandArgs args)```
Get the members using `GeoReference` as center of the query within the boundaries of a given `predicate` applying `RedisGeoCommands.GeoRadiusCommandArgs`.
`default Long`
```searchAndStore(K key, K destKey, Circle within)```
Get the members within the boundaries of a given `Circle` and store results at `destKey`.
`default Long`
```searchAndStore(K key, K destKey, GeoReference<M> reference, Distance radius)```
Get the members using `GeoReference` as center of the query within the boundaries of a given `radius` and store results at `destKey`.
`default Long`
```searchAndStore(K key, K destKey, GeoReference<M> reference, Distance radius, RedisGeoCommands.GeoSearchStoreCommandArgs args)```
Get the members using `GeoReference` as center of the query within the boundaries of a given `radius` applying `RedisGeoCommands.GeoRadiusCommandArgs` and store results at `destKey`.
`default Long`
```searchAndStore(K key, K destKey, GeoReference<M> reference, BoundingBox boundingBox)```
Get the members using `GeoReference` as center of the query within the boundaries of a given bounding box and store results at `destKey`.
`default Long`
```searchAndStore(K key, K destKey, GeoReference<M> reference, BoundingBox boundingBox, RedisGeoCommands.GeoSearchStoreCommandArgs args)```
Get the members using `GeoReference` as center of the query within the boundaries of a given bounding box applying `RedisGeoCommands.GeoRadiusCommandArgs` and store results at `destKey`.
`Long`
```searchAndStore(K key, K destKey, GeoReference<M> reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchStoreCommandArgs args)```
Get the members using `GeoReference` as center of the query within the boundaries of a given `predicate` applying `RedisGeoCommands.GeoRadiusCommandArgs` and store results at `destKey`.
• ## Method Details

Long add(K key, Point point, M member)
Add `Point` 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.
Since:
2.0

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

Add `Map` 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.
Since:
2.0

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
• ### distance

Distance distance(K key, M member1, M member2)
Get the `Distance` between 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
• ### distance

Distance distance(K key, M member1, M member2, Metric metric)
Get the `Distance` between member1 and member2 in the given `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.
Since:
2.0
• ### hash

hash(K key, M... members)
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
• ### position

position(K key, M... members)
Get the `Point` representation 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

Get the members within the boundaries of a given `Circle`.
Parameters:
`key` - must not be null.
`within` - must not be null.
Returns:
never null unless used in pipeline / transaction.
Since:
2.0

Get the members within the boundaries of a given `Circle` applying `RedisGeoCommands.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

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

radius(K key, M member, Distance distance)
Get the members within the circle defined by the members coordinates and given radius applying `Metric`.
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

Get the members within the circle defined by the members coordinates and given radius applying `Metric` and `RedisGeoCommands.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
• ### remove

Long remove(K key, M... members)
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

default  search(K key, Circle within)
Get the members within the boundaries of a given `Circle`.
Parameters:
`key` - must not be null.
`within` - must not be null.
Returns:
never null unless used in pipeline / transaction.
Since:
2.6
• ### search

default  search(K key, GeoReference<M> reference, Distance radius)
Get the members using `GeoReference` as center of the query within the boundaries of a given `radius`.
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
• ### search

default  search(K key, GeoReference<M> reference, Distance radius, RedisGeoCommands.GeoSearchCommandArgs args)
Get the members using `GeoReference` as center of the query within the boundaries of a given `radius` applying `RedisGeoCommands.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
• ### search

default  search(K key, GeoReference<M> reference, BoundingBox boundingBox)
Get the members using `GeoReference` as 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
• ### search

default  search(K key, GeoReference<M> reference, BoundingBox boundingBox, RedisGeoCommands.GeoSearchCommandArgs args)
Get the members using `GeoReference` as center of the query within the boundaries of a given bounding box applying `RedisGeoCommands.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
• ### search

search(K key, GeoReference<M> reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchCommandArgs args)
Get the members using `GeoReference` as center of the query within the boundaries of a given `predicate` applying `RedisGeoCommands.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
• ### searchAndStore

default Long searchAndStore(K key, K destKey, Circle within)
Get the members within the boundaries of a given `Circle` and store results at `destKey`.
Parameters:
`key` - must not be null.
`within` - must not be null.
Returns:
never null unless used in pipeline / transaction.
Since:
2.6
• ### searchAndStore

default Long searchAndStore(K key, K destKey, GeoReference<M> reference, Distance radius)
Get the members using `GeoReference` as center of the query within the boundaries of a given `radius` and store results at `destKey`.
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
• ### searchAndStore

default Long searchAndStore(K key, K destKey, GeoReference<M> reference, Distance radius, RedisGeoCommands.GeoSearchStoreCommandArgs args)
Get the members using `GeoReference` as center of the query within the boundaries of a given `radius` applying `RedisGeoCommands.GeoRadiusCommandArgs` and store results at `destKey`.
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
• ### searchAndStore

default Long searchAndStore(K key, K destKey, GeoReference<M> reference, BoundingBox boundingBox)
Get the members using `GeoReference` as center of the query within the boundaries of a given bounding box and store results at `destKey`.
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
• ### searchAndStore

default Long searchAndStore(K key, K destKey, GeoReference<M> reference, BoundingBox boundingBox, RedisGeoCommands.GeoSearchStoreCommandArgs args)
Get the members using `GeoReference` as center of the query within the boundaries of a given bounding box applying `RedisGeoCommands.GeoRadiusCommandArgs` and store results at `destKey`.
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
• ### searchAndStore

Long searchAndStore(K key, K destKey, GeoReference<M> reference, GeoShape geoPredicate, RedisGeoCommands.GeoSearchStoreCommandArgs args)
Get the members using `GeoReference` as center of the query within the boundaries of a given `predicate` applying `RedisGeoCommands.GeoRadiusCommandArgs` and store results at `destKey`.
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