GEORADIUS_RO
Deprecated
As of Redis version 6.2.0, this command is regarded as deprecated.
It can be replaced by GEOSEARCH with the BYRADIUS argument when migrating or writing new code.
GEORADIUS_RO key longitude latitude radius <M | KM | FT | MI> [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC]
- Available since:
- Redis Open Source 3.2.10
- Time complexity:
- O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index.
- ACL categories:
-
@read,@geo,@slow, - Compatibility:
- Redis Software and Redis Cloud compatibility
Read-only variant of the GEORADIUS command.
This command is identical to the GEORADIUS command, except that it doesn't support the optional STORE and STOREDIST parameters.
Required arguments
key
The name of the key that holds the geospatial index (a sorted set).
longitude
The longitude of the center point.
latitude
The latitude of the center point.
radius
The radius of the search circle, in the unit given by the following argument.
M | KM | FT | MI
The unit for radius: meters (M), kilometers (KM), feet (FT), or miles (MI).
Optional arguments
WITHCOORD
Also return the longitude and latitude of each matching item.
WITHDIST
Also return the distance of each matching item from the center, in the same unit as the radius.
WITHHASH
Also return the raw 52-bit geohash-encoded score of each matching item.
COUNT count [ANY]
Return at most count matches. With ANY, the command returns as soon as enough matches are found — faster, but the results may be unsorted.
ASC | DESC
Sort the results by distance from the center: nearest first (ASC) or farthest first (DESC).
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Deprecated as of Redis v6.2.0. |
Return information
One of the following:
- If no
WITH*option is specified, an Array reply of matched member names - If
WITHCOORD,WITHDIST, orWITHHASHoptions are specified, the command returns an Array reply of arrays, where each sub-array represents a single item:- The distance from the center as a floating point number, in the same unit specified in the radius.
- The Geohash integer.
- The coordinates as a two items x,y array (longitude,latitude).
History
- Starting with Redis version 6.2.0: Added the
ANYoption forCOUNT. - Starting with Redis version 7.0.0: Added support for uppercase unit names.