Skip to main content

On Quadtree and Geohash algorithm

·1 min
  • How do you partition a quadtree?
    • All the places, i.e. points of interest such as restaurants, can be partitioned the usual way: think of them as IDs and use key-range or hash-based partitioning.
    • What about the tree itself?
      • That’s not entirely clear but I think this can be replicated in full on all the nodes since the data should be pretty small.
  • How do you decide hash length for geohashing?
    • Longer = more precision.
      • Can lead to more empty hashes.
      • If search radius is high, this will require searches for more number of hashes.
        • These can run in parallel though. Results can be aggregated and ranked once at the end.
    • Smaller length:
      • Some hashes may have huge number of points.
        • If we partition the hashes randomly across multiple machines (for example, by hashing the geohashes), the distribution might turn out to be uniform on average.