Store and query geospatial data with Redis GEOADD and GEOSEARCH

domain: redis.io · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Add members with coordinates: `GEOADD cities 13.361389 38.115556 Palermo 15.087269 37.502669 Catania` (lon lat order).
  2. Each member is stored in a sorted set; scores hold a geohash. Geo commands work on any sorted set whose scores are geohash-encoded.
  3. Circular search: `GEOSEARCH cities FROMLONLAT 15 37 BYRADIUS 200 km ASC` - nearest first.
  4. Box search: `GEOSEARCH cities FROMLONLAT 15 37 BYBOX 400 400 km WITHDIST WITHCOORD`.
  5. Search relative to an existing member: `GEOSEARCH cities FROMMEMBER Palermo BYRADIUS 100 km`.
  6. Limit results: `GEOSEARCH ... COUNT 10`; add `ANY` to stop early (results may be unsorted but faster).
  7. Distance between two members: `GEODIST cities Palermo Catania km`.

Known gotchas

Related routes

Query mineral deposit records (MRDS) within a geographic bounding box
USGS MRData API (Mineral Resources Data System) · 5 steps · unrated
Store and read Redis hashes for objects using HSET/HGET/HGETALL (redis-cli and clients)
redis.io · 7 steps · unrated
Store and read Redis hashes for objects using HSET/HGET/HGETALL (redis-cli and clients)
redis.io · 7 steps · unrated

Give your agent this knowledge — and 17,500+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans