Package org.redisson.api
Interface RGeo<V>
-
- Type Parameters:
V
- type of value
- All Superinterfaces:
Iterable<V>
,RExpirable
,RExpirableAsync
,RGeoAsync<V>
,RObject
,RObjectAsync
,RScoredSortedSet<V>
,RScoredSortedSetAsync<V>
,RSortable<Set<V>>
,RSortableAsync<Set<V>>
- All Known Implementing Classes:
RedissonGeo
public interface RGeo<V> extends RScoredSortedSet<V>, RGeoAsync<V>
Geospatial items holder.- Author:
- Nikita Koksharov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.redisson.api.RScoredSortedSet
RScoredSortedSet.Aggregate
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description long
add(double longitude, double latitude, V member)
Adds geospatial member.long
add(GeoEntry... entries)
Adds geospatial members.Boolean
addIfExists(double longitude, double latitude, V member)
Adds geospatial member only if it's already exists.long
addIfExists(GeoEntry... entries)
Adds geospatial members only if it's already exists.Double
dist(V firstMember, V secondMember, GeoUnit geoUnit)
Returns distance between members inGeoUnit
units.Map<V,String>
hash(V... members)
Returns 11 characters long Geohash string mapped by defined member.Map<V,GeoPosition>
pos(V... members)
Returns geo-position mapped by defined member.List<V>
radius(double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.List<V>
radius(double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.List<V>
radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.List<V>
radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.List<V>
radius(V member, double radius, GeoUnit geoUnit)
Deprecated.List<V>
radius(V member, double radius, GeoUnit geoUnit, int count)
Deprecated.List<V>
radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.List<V>
radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.long
radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.long
radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.long
radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.long
radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit)
Deprecated.long
radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit, int count)
Deprecated.long
radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.long
radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.long
radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.long
radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.long
radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit)
Deprecated.long
radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, int count)
Deprecated.long
radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.Map<V,Double>
radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.Map<V,Double>
radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.Map<V,Double>
radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.Map<V,Double>
radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.Map<V,Double>
radiusWithDistance(V member, double radius, GeoUnit geoUnit)
Deprecated.Map<V,Double>
radiusWithDistance(V member, double radius, GeoUnit geoUnit, int count)
Deprecated.Map<V,Double>
radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.Map<V,Double>
radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.Map<V,GeoPosition>
radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.Map<V,GeoPosition>
radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.Map<V,GeoPosition>
radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.Map<V,GeoPosition>
radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.Map<V,GeoPosition>
radiusWithPosition(V member, double radius, GeoUnit geoUnit)
Deprecated.Map<V,GeoPosition>
radiusWithPosition(V member, double radius, GeoUnit geoUnit, int count)
Deprecated.Map<V,GeoPosition>
radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.Map<V,GeoPosition>
radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.List<V>
search(GeoSearchArgs args)
Returns the members of a sorted set, which are within the borders of specified search conditions.Map<V,Double>
searchWithDistance(GeoSearchArgs args)
Returns the distance mapped by member of a sorted set, which are within the borders of specified search conditions.Map<V,GeoPosition>
searchWithPosition(GeoSearchArgs args)
Returns the position mapped by member of a sorted set, which are within the borders of specified search conditions.long
storeSearchTo(String destName, GeoSearchArgs args)
Finds the members of a sorted set, which are within the borders of specified search conditions.long
storeSortedSearchTo(String destName, GeoSearchArgs args)
Finds the members of a sorted set, which are within the borders of specified search conditions.boolean
tryAdd(double longitude, double latitude, V member)
Adds geospatial member only if has not been added before.long
tryAdd(GeoEntry... entries)
Adds geospatial members only if has not been added before.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLive
-
Methods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
-
Methods inherited from interface org.redisson.api.RGeoAsync
addAsync, addAsync, addIfExistsAsync, addIfExistsAsync, distAsync, hashAsync, posAsync, radiusAsync, radiusAsync, radiusAsync, radiusAsync, radiusAsync, radiusAsync, radiusAsync, radiusAsync, radiusStoreSortedToAsync, radiusStoreSortedToAsync, radiusStoreSortedToAsync, radiusStoreSortedToAsync, radiusStoreSortedToAsync, radiusStoreSortedToAsync, radiusStoreToAsync, radiusStoreToAsync, radiusStoreToAsync, radiusStoreToAsync, radiusStoreToAsync, radiusStoreToAsync, radiusWithDistanceAsync, radiusWithDistanceAsync, radiusWithDistanceAsync, radiusWithDistanceAsync, radiusWithDistanceAsync, radiusWithDistanceAsync, radiusWithDistanceAsync, radiusWithDistanceAsync, radiusWithPositionAsync, radiusWithPositionAsync, radiusWithPositionAsync, radiusWithPositionAsync, radiusWithPositionAsync, radiusWithPositionAsync, radiusWithPositionAsync, radiusWithPositionAsync, searchAsync, searchWithDistanceAsync, searchWithPositionAsync, storeSearchToAsync, storeSortedSearchToAsync, tryAddAsync, tryAddAsync
-
Methods inherited from interface org.redisson.api.RObject
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Methods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
-
Methods inherited from interface org.redisson.api.RScoredSortedSet
add, addAll, addAndGetRank, addAndGetRevRank, addAndGetRevRank, addIfExists, addIfGreater, addIfLess, addScore, addScoreAndGetRank, addScoreAndGetRevRank, clear, contains, containsAll, count, diff, entryRange, entryRange, entryRange, entryRangeReversed, entryRangeReversed, entryRangeReversed, first, firstScore, getScore, getScore, intersection, intersection, intersection, intersection, isEmpty, iterator, iterator, iterator, last, lastScore, mapReduce, pollFirst, pollFirst, pollFirst, pollFirstFromAny, pollLast, pollLast, pollLast, pollLastFromAny, random, random, randomEntries, rangeTo, rangeTo, rangeTo, rank, readAll, readDiff, readIntersection, readIntersection, readIntersection, readIntersection, readUnion, readUnion, readUnion, readUnion, remove, removeAll, removeRangeByRank, removeRangeByScore, retainAll, revRangeTo, revRangeTo, revRangeTo, revRank, revRank, size, stream, stream, stream, stream, subscribeOnFirstElements, subscribeOnLastElements, takeFirst, takeLast, toArray, toArray, tryAdd, union, union, union, union, unsubscribe, valueRange, valueRange, valueRange, valueRangeReversed, valueRangeReversed, valueRangeReversed
-
Methods inherited from interface org.redisson.api.RScoredSortedSetAsync
addAllAsync, addAndGetRankAsync, addAndGetRevRankAsync, addAndGetRevRankAsync, addAsync, addIfExistsAsync, addIfGreaterAsync, addIfLessAsync, addScoreAndGetRankAsync, addScoreAndGetRevRankAsync, addScoreAsync, containsAllAsync, containsAsync, countAsync, diffAsync, entryRangeAsync, entryRangeAsync, entryRangeAsync, entryRangeReversedAsync, entryRangeReversedAsync, entryRangeReversedAsync, firstAsync, firstScoreAsync, getScoreAsync, getScoreAsync, intersectionAsync, intersectionAsync, intersectionAsync, intersectionAsync, lastAsync, lastScoreAsync, pollFirstAsync, pollFirstAsync, pollFirstAsync, pollFirstFromAnyAsync, pollLastAsync, pollLastAsync, pollLastAsync, pollLastFromAnyAsync, randomAsync, randomAsync, randomEntriesAsync, rangeToAsync, rangeToAsync, rangeToAsync, rankAsync, readAllAsync, readDiffAsync, readIntersectionAsync, readIntersectionAsync, readIntersectionAsync, readIntersectionAsync, readUnionAsync, readUnionAsync, readUnionAsync, readUnionAsync, removeAllAsync, removeAsync, removeRangeByRankAsync, removeRangeByScoreAsync, retainAllAsync, revRangeToAsync, revRangeToAsync, revRangeToAsync, revRankAsync, revRankAsync, sizeAsync, takeFirstAsync, takeLastAsync, tryAddAsync, unionAsync, unionAsync, unionAsync, unionAsync, valueRangeAsync, valueRangeAsync, valueRangeAsync, valueRangeReversedAsync, valueRangeReversedAsync, valueRangeReversedAsync
-
Methods inherited from interface org.redisson.api.RSortable
readSort, readSort, readSort, readSort, readSort, readSort, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, readSortAlpha, sortTo, sortTo, sortTo, sortTo, sortTo, sortTo
-
Methods inherited from interface org.redisson.api.RSortableAsync
readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAlphaAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, readSortAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync, sortToAsync
-
-
-
-
Method Detail
-
add
long add(double longitude, double latitude, V member)
Adds geospatial member.- Parameters:
longitude
- - longitude of objectlatitude
- - latitude of objectmember
- - object itself- Returns:
- number of elements added to the sorted set, not including elements already existing for which the score was updated
-
add
long add(GeoEntry... entries)
Adds geospatial members.- Parameters:
entries
- - objects- Returns:
- number of elements added to the sorted set, not including elements already existing for which the score was updated
-
addIfExists
Boolean addIfExists(double longitude, double latitude, V member)
Adds geospatial member only if it's already exists.Requires Redis 6.2.0 and higher.
- Parameters:
longitude
- - longitude of objectlatitude
- - latitude of objectmember
- - object itself- Returns:
- number of elements added to the sorted set
-
addIfExists
long addIfExists(GeoEntry... entries)
Adds geospatial members only if it's already exists.Requires Redis 6.2.0 and higher.
- Parameters:
entries
- - objects- Returns:
- number of elements added to the sorted set
-
tryAdd
boolean tryAdd(double longitude, double latitude, V member)
Adds geospatial member only if has not been added before.Requires Redis 6.2.0 and higher.
- Parameters:
longitude
- - longitude of objectlatitude
- - latitude of objectmember
- - object itself- Returns:
- number of elements added to the sorted set
-
tryAdd
long tryAdd(GeoEntry... entries)
Adds geospatial members only if has not been added before.Requires Redis 6.2.0 and higher.
- Parameters:
entries
- - objects- Returns:
- number of elements added to the sorted set
-
dist
Double dist(V firstMember, V secondMember, GeoUnit geoUnit)
Returns distance between members inGeoUnit
units.- Parameters:
firstMember
- - first objectsecondMember
- - second objectgeoUnit
- - geo unit- Returns:
- distance
-
hash
Map<V,String> hash(V... members)
Returns 11 characters long Geohash string mapped by defined member.- Parameters:
members
- - objects- Returns:
- hash mapped by object
-
pos
Map<V,GeoPosition> pos(V... members)
Returns geo-position mapped by defined member.- Parameters:
members
- - objects- Returns:
- geo position mapped by object
-
search
List<V> search(GeoSearchArgs args)
Returns the members of a sorted set, which are within the borders of specified search conditions.Usage examples:
List objects = geo.search(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS) .order(GeoOrder.ASC) .count(1)));
List objects = geo.search(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS)));
Requires Redis 3.2.10 and higher.
- Parameters:
args
- - search conditions object- Returns:
- list of memebers
-
radius
@Deprecated List<V> radius(double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.
-
radius
@Deprecated List<V> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radius
@Deprecated List<V> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.
-
radius
@Deprecated List<V> radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
searchWithDistance
Map<V,Double> searchWithDistance(GeoSearchArgs args)
Returns the distance mapped by member of a sorted set, which are within the borders of specified search conditions.Usage examples:
List objects = geo.searchWithDistance(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS) .order(GeoOrder.ASC) .count(1)));
List objects = geo.searchWithDistance(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS)));
Requires Redis 3.2.10 and higher.
- Parameters:
args
- - search conditions object- Returns:
- distance mapped by object
-
radiusWithDistance
@Deprecated Map<V,Double> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.
-
radiusWithDistance
@Deprecated Map<V,Double> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radiusWithDistance
@Deprecated Map<V,Double> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.
-
radiusWithDistance
@Deprecated Map<V,Double> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
searchWithPosition
Map<V,GeoPosition> searchWithPosition(GeoSearchArgs args)
Returns the position mapped by member of a sorted set, which are within the borders of specified search conditions.Usage examples:
List objects = geo.searchWithPosition(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS) .order(GeoOrder.ASC) .count(1)));
List objects = geo.searchWithPosition(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS)));
Requires Redis 3.2.10 and higher.
- Parameters:
args
- - search conditions object- Returns:
- position mapped by object
-
radiusWithPosition
@Deprecated Map<V,GeoPosition> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.
-
radiusWithPosition
@Deprecated Map<V,GeoPosition> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radiusWithPosition
@Deprecated Map<V,GeoPosition> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.
-
radiusWithPosition
@Deprecated Map<V,GeoPosition> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
radius
@Deprecated List<V> radius(V member, double radius, GeoUnit geoUnit)
Deprecated.
-
radius
@Deprecated List<V> radius(V member, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radius
@Deprecated List<V> radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.
-
radius
@Deprecated List<V> radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
radiusWithDistance
@Deprecated Map<V,Double> radiusWithDistance(V member, double radius, GeoUnit geoUnit)
Deprecated.
-
radiusWithDistance
@Deprecated Map<V,Double> radiusWithDistance(V member, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radiusWithDistance
@Deprecated Map<V,Double> radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.
-
radiusWithDistance
@Deprecated Map<V,Double> radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
radiusWithPosition
@Deprecated Map<V,GeoPosition> radiusWithPosition(V member, double radius, GeoUnit geoUnit)
Deprecated.
-
radiusWithPosition
@Deprecated Map<V,GeoPosition> radiusWithPosition(V member, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radiusWithPosition
@Deprecated Map<V,GeoPosition> radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder)
Deprecated.
-
radiusWithPosition
@Deprecated Map<V,GeoPosition> radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
storeSearchTo
long storeSearchTo(String destName, GeoSearchArgs args)
Finds the members of a sorted set, which are within the borders of specified search conditions.Stores result to
destName
.Usage examples:
long count = geo.storeSearchTo(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS) .order(GeoOrder.ASC) .count(1)));
long count = geo.storeSearchTo(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS)));
- Parameters:
args
- - search conditions object- Returns:
- length of result
-
radiusStoreTo
@Deprecated long radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.
-
radiusStoreTo
@Deprecated long radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radiusStoreTo
@Deprecated long radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
radiusStoreTo
@Deprecated long radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit)
Deprecated.
-
radiusStoreTo
@Deprecated long radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radiusStoreTo
@Deprecated long radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
storeSortedSearchTo
long storeSortedSearchTo(String destName, GeoSearchArgs args)
Finds the members of a sorted set, which are within the borders of specified search conditions.Stores result to
destName
sorted by distance.Usage examples:
long count = geo.storeSortedSearchTo(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS) .order(GeoOrder.ASC) .count(1)));
long count = geo.storeSortedSearchTo(GeoSearchArgs.from(15, 37) .radius(200, GeoUnit.KILOMETERS)));
- Parameters:
args
- - search conditions object- Returns:
- length of result
-
radiusStoreSortedTo
@Deprecated long radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit)
Deprecated.
-
radiusStoreSortedTo
@Deprecated long radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radiusStoreSortedTo
@Deprecated long radiusStoreSortedTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
radiusStoreSortedTo
@Deprecated long radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit)
Deprecated.
-
radiusStoreSortedTo
@Deprecated long radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit, int count)
Deprecated.
-
radiusStoreSortedTo
@Deprecated long radiusStoreSortedTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count)
Deprecated.
-
-