GEORADIUS_RO(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– GEORADIUS_RO β€” bestie's guide to the read-only geo radius πŸ’–

okay so real talk, this is the valkey command manual for GEORADIUS_RO, and if you're here you're probably trying to find everybody hanging out near a spot on the map without accidentally changing anything. iconic behavior, honestly.


✨ NAME ✨

georadius_ro β€” hands you back all the members in a geospatial index that live within a certain distance of a coordinate. that's it, that's the whole job. πŸ’…


🌸 SYNOPSIS 🌸

GEORADIUS_RO key longitude latitude radius <M | KM | FT | MI>
[WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC]

so you're passing a key, a longitude, a latitude, a radius, and the radius has to be tagged with one of these units: M, KM, FT, or MI. then a lil pile of optional extras in brackets. the brackets mean optional bestie, don't type the brackets, i'm begging 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

it's the read-only variant of the GEORADIUS command. like, the same energy, but it pinky-promises not to write anything.

it's identical to GEORADIUS in every way EXCEPT it does not support the optional STORE and STOREDIST parameters. no storing, no saving, no side quests. purely a vibe check on your geo data. ✨

🌈 Alternative

GEOSEARCH with the BYRADIUS argument. if you're feeling modern, that's the glow-up version. πŸ‘‘


πŸŽ€ REPLY πŸŽ€

so here's what you get back, and it depends on what you asked for:

  • if you specified no WITH* option at all, you get a valkey-protocol(7) Array reply of matched member names. just names. clean, simple, no notes. πŸ’–
  • if you did specify WITHCOORD, WITHDIST, or WITHHASH, the command returns a valkey-protocol(7) Array reply of arrays, where each sub-array is one single item. and each of those sub-arrays contains:
    • the distance from the center as a floating point number, expressed in the same unit you specified in the radius. yes, same unit. keep track of your units bestie, i'm serious πŸ™ˆ
    • the Geohash integer.
    • the coordinates as a two-item x,y array, which is (longitude,latitude). longitude first. always longitude first. do not fight me on this. ⭐

πŸ’€ 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
  • M is the number of items inside the index

translation: the more stuff in your box, the more work it does. not a huge deal but like, know it. πŸ”₯


πŸ‘‘ ACL CATEGORIES πŸ‘‘

@geo @read @slow

(read-only, geo-flavored, and yeah, it's tagged slow. we respect the honesty.)


🧚 HISTORY 🧚

  • Available since: 3.2.10
  • Changed in 6.2.0: Added the ANY option for COUNT.
  • Changed in 7.0.0: Added support for uppercase unit names.

look at her growing up πŸ₯Ή


🫢 SEE ALSO 🫢

go read all of them, the whole friend group is lovely πŸ’œ


fr fr remember: GEORADIUS_RO will never store anything for you. if you wanted STORE or STOREDIST, you're in the wrong manpage and you need to go find GEORADIUS. no cap. 😭

and that's the whole thing! this page is from the valkey 9.0.0 command manual, dated 2025-10-21. go forth and query your geospatial index, you absolute icon πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from