Quadtree Visualizer
Enter any latitude and longitude and watch a quadtree find the places near you. It splits space into four quadrants, over and over, descending only into the squares that overlap your search area.
How a quadtree works
A quadtree indexes 2-D data by dividing space on a fixed grid: any square holding too many points is split into four quadrants, and the crowded ones keep splitting. A city ends up finely subdivided while an ocean stays one big square. To answer a “near me” query, you start at the whole-map square and only descend into the quadrants that overlap your search box, pruning the rest.
What you're seeing
- The blue box is your search area; amber outlines are the cells the search actually opens.
- Try a dense city vs the open ocean — watch how much deeper the path goes where points cluster.
Quadtrees shine in memory — image compression, game maps, collision detection. Databases usually reach for an R-tree instead, because it stays balanced. Full write-up: MySQL Internals.