RELIABILITY, SECURITY & CASE STUDIES · SUBTOPIC
Geohash, Quadtrees & Uber H3
Compare static grids, adaptive trees, and hexagonal spatial indexes.
AdvancedPart of Geo-Spatial & Location Systems
Subtopics in Geo-Spatial & Location Systems (2)
In plain words
Geohash draws a fixed grid over the world map. A Quadtree splits busy downtown squares into tiny tiles while leaving empty oceans as one huge square. H3 uses hexagons so distance to every neighbor is equal.
Think of it like…
City map squares (Geohash), zooming deeper only in crowded downtown (Quadtree), or a honeycomb grid (H3).
Loading interactive diagram
Loading interactive exercise
Theory & how it works
Why Uber prefers H3 hexagons over squares
On a square grid, diagonal neighbors are √2 ≈ 1.41× farther away from the center than edge neighbors. Every neighbor of a hexagon is the exact same distance from the center - making surge-pricing and radius rings much smoother.
Key points & practical guide
Summary checklist
- Always search center cell + 8 neighbors (or k-ring in H3) to avoid boundary misses
- Use Redis GEO / in-memory index for moving vehicles (4s updates)
- Use Quadtree / PostGIS R-Tree for static businesses
When to use it
- Ride-hailing, food delivery, nearby friends/places
Watch out for
- Writing every 4-second GPS ping straight to disk SQL - keep live driver locations in RAM/Redis with a short TTL
Quick check
Loading quiz