Lesson 11 of 12
18. Geospatial Indexing

Sources

3 min read+10 XP

Source notes

  • Geohash encoding (alternating bits, base-32 alphabet without a, i, l, o) and the test vector (57.64911, 10.40744) → u4pruydqqvj: standard geohash references; verified by the chapter's code.
  • Redis GEO: sorted set scored by a 52-bit interleaved geohash; radius queries check the centre area plus 8 neighbours; GEOSEARCH replaces GEORADIUS from Redis 6.2. Redis documentation, GEOADD and GEORADIUS pages, checked 2026-10-08.
  • S2: cell levels 0 to 30, leaf cells about 1 cm across. S2 Geometry documentation, "S2Cell Hierarchy", checked 2026-10-08.
  • H3: hexagonal hierarchical index from Uber, 16 resolutions, each finer cell about one-seventh the area, open source. Uber Engineering blog, "H3: Uber's Hexagonal Hierarchical Spatial Index", checked 2026-10-08.
  • Haversine formula and Earth's mean radius 6,371 km: standard references. Cell sizes and degree lengths computed by the chapter's code.
  • Rider counts, ping interval and speeds are illustrative assumptions; arithmetic computed 2026-10-08.
  • Level 3 and Level 4 code: tested 2026-10-08 (code/ch18_geospatial.py, all checks pass).