How Geoprox Works

The Problem

Initially, for the May 2024 Rust Indy.rs meetup, the proof of concept problem began with ride-share pairing like Uber or Lyft.

Ride pairing depends on being able to track and pair a set of drivers within the vicinity of some location (i.e., the pickup location of an order).

Since then, the problem has generalized to how can we efficiently track and retrieve resources geographically near some location.

Objectives

  • Keep track of the approximate location of objects.
  • Search should return a set of objects within a radius of the search location.

Solution

Index the objects and hash their key and geographical position. Using a geohash to encode the approximate location, we can map geohash prefixes into the set of objects contained in the geohash using a Prefix Tree stored in-memory.

We can efficiently partition the search space and perform a nearest neighbor search on a merged set of objects in the search region and return the results.