Quadtree

A quadtree is a data structure that's useful for finding points near a single
point, by searching inside an area surrounding the point of interest.

Using a quadtree, you can search efficiently for points within a 2D range,
where those points are defined as lat/lng coordinates or as cartesian (x, y)
coordinates. The quadtree stores buckets of coordinates in nodes, and indexes
them by region (bounding box). To find a given coordinate pair, you traverse
through the nodes of the quadtree.