



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




ECS 266 – Spatial Databases Michael Gertz © 2008 UC Davis
ECS 266 – Spatial Databases
Learning Objectives
Literature
ECS 266 – Spatial Databases Michael Gertz © 2008 UC Davis 3. Computational Geometry^3
ECS 266 – Spatial Databases
ECS 266 – Spatial Databases Michael Gertz © 2008 UC Davis 3. Computational Geometry^7
ECS 266 – Spatial Databases
Example : Given a set of rectangles S. Find all pairwise intersections. Given the worst case complexity, an output sensitive algorithm is worthwhile.
Key observations:
ECS 266 – Spatial Databases Michael Gertz © 2008 UC Davis 3. Computational Geometry^9
Event points are the 2 × | S | left and right x coordinates, ordered in E. A data structure L is maintained for the list of active rectangles that intersect with l.
Operations at each event point:
ECS 266 – Spatial Databases
begin sort the 2 n xmin and xmax values of S and place them in E L = {} while ( E <> {} ) do begin
if ( p is the left edge of a rectangle r ) then begin insert ( r, L ) search and report the rectangles in L intersecting r end if if ( p is the right edge of a rectangle r ) then delete (r, L) end while end Complexity: O(n log n+k), with k being the number of intersections
ECS 266 – Spatial Databases Michael Gertz © 2008 UC Davis 3. Computational Geometry^13
ECS 266 – Spatial Databases