Spatial Join Yan Huang firstname.lastname@example.org
Spatial Join • Given two sets of spatial data • Find the pair of objects satisfying certain spatial predicate • e.g. INSIDE, WITHIN
Two Methods • On-the-fly • Indexing-based
On-the-fly • Nested-loop • Block-nested-loop for large dataset
Indexing: Z-order • Grid the space • Create a z-order of the cells • An object is represented by MBR and have a set of z-values • Index z-values using on-dimensional indexing such as B+ tree • INSIDE? • WITHIN?
Filter-and-refine • Each object is represented by it MBR • Join in MBR level first • Only those past MBR level filtering will be check for actually relationship • INSIDE? • WITHIN?
R-tree indexing from wikipedia
Quadtree From wikipedia
Tree-matching • Simultaneously traverse two tree nodes TreeM(R1,R2) • If the two nodes are non-disjoint • If R1 is leaf • R2 is not leaf, recursively call TreeM(R1,R2.child) for each child of R2. • Otherwise, find pairs from R1 and R2 • Otherwise • If R2 is leaf, recursively call TreeM(R1.child,R2) for each child of R1. • Otherwise, recursively call TreeM(R1.child,R2.child) for each child of R1 and each child of R2.
Partition-based Merge Join • Jignesh M. Patel , David J. DeWitt, Partition Based Spatial-Merge Join, SIGMOD 1996.