The STRtree: Sort-Tile-Recursive Spatial Indexing

Computing the sizing parameters of an STR-packed R-tree and stepping through the sort-and-tile bulk-loading procedure to form leaf nodes and their minimum bounding rectangles.

Step 1 of 157%

Tutorial

Introduction

When the full set of rectangles to be indexed is known in advance, we can build an R-tree far more efficiently than by inserting one rectangle at a time. The Sort-Tile-Recursive (STR) algorithm bulk-loads the data into a tightly packed, nearly-balanced tree by sorting on one axis at a time and slicing the sorted list into uniform groups.

For a 2D dataset of NN rectangles with node capacity MM, STR begins by computing three sizing parameters:

  • Number of leaf nodes: L=N/M.L = \lceil N/M \rceil.
  • Number of vertical slices: S=L.S = \lceil \sqrt{L}\, \rceil.
  • Rectangles per slice: SM.S \cdot M.

Each slice will eventually be split into SS leaves of MM rectangles, so the leaf level holds at most S2S^2 leaves and S2MS^2 M rectangles. The last slice (and the last leaf within it) may be partially filled when N<S2M.N < S^2 M.

For example, with N=18N = 18 and M=2:M = 2{:}

L=18/2=9,S=9=3,SM=6.L = \lceil 18/2 \rceil = 9, \qquad S = \lceil \sqrt{9}\, \rceil = 3, \qquad S \cdot M = 6.

We partition the 18 rectangles into 3 vertical slices of 6 rectangles each, and within each slice we form 3 leaves of 2 rectangles.

navigate · Enter open · Esc close · ⌘K/Ctrl K toggle