Home▸Algorithms & AI▸R-Tree Spatial Index — 2D Top-Down Map

R-Tree Spatial Index — 2D Top-Down Map

2D top-down map view of a real R-tree spatial index: insert objects, draw a query rectangle by dragging, and watch nested bounding boxes prune the branches that don't overlap it.

Algorithms & AI2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-r-tree-spatial-index-lab ↗ Open standalone

This 2D companion draws the same real R-tree — minimum-enlargement insertion and quadratic node splitting, exactly as spatial databases like PostGIS implement it — as a flat top-down map instead of an orbit-controlled 3D scene. Click the map to insert your own objects, drag to draw a custom query rectangle, or let the auto-query cycle run, and watch which nested bounding boxes get visited versus pruned entirely.

⚙ Under the hood

2D top-down R-tree lab with a real minimum-enlargement insertion rule and quadratic-cost node splitting; drag to query and watch non-overlapping branches get pruned live.

r-treespatial-indexdata-structuresalgorithmsgispostgis

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)