HomeAlgorithms & AIR-Trees: The Data Structure That Makes Map Queries Fast

🗺️ R-Trees: The Data Structure That Makes Map Queries Fast

Learn how the R-tree data structure indexes points, rectangles, and shapes on a map using nested bounding boxes, and why it makes spatial range queries like find all restaurants nearby dramatically faster.

Algorithms & AI3DModerate60 FPS
r-tree-spatial-index-lab ↗ Open standalone

This simulator visually builds an R-tree from inserted spatial objects, showing how their bounding rectangles nest hierarchically and how a range query prunes non-overlapping branches instead of scanning every object.

🔬 What It Demonstrates

This simulator visually builds an R-tree from inserted spatial objects, showing how their bounding rectangles nest hierarchically and how a range query prunes non-overlapping branches instead of scanning every object.

🎮 How to Use

Insert points or rectangles onto the map canvas to watch the R-tree grow and split, then draw a query rectangle to see which branches get searched and which get pruned away.

💡 Did You Know?

A well-tuned R-tree can answer a spatial range query over millions of objects by examining only a few dozen bounding rectangles, thanks entirely to how aggressively non-overlapping branches get pruned.

⚙ Under the hood

Learn how the R-tree data structure indexes points, rectangles, and shapes on a map using nested bounding boxes, and why it makes spatial range queries like find all restaurants nearby dramatically faster.

r-treespatial-indexdata-structuresalgorithmsgispostgiscomputer-sciencedatabases

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)