1
1
CG Lecture 5 CG Lecture 5 Point Location Point Location
1. Problem definition and motivation 2. Point in polygon queries revisited 3. The slab method 4. The monotone chain method 5. The trapezoidal map method
- Subdivision properties
- Random incremental construction
- Expected complexity analysis
6. The triangulation refinement method
2
Problem Definition Problem Definition
- Preprocess a planar map S.
Given a query point q, report the face of S containing q.
- Goal: O(n)-size data structure
that enables O(logn) query time.
- Application: Region containing
acquired GPS coordinates.
- Trivial Solution: O(n) query time,
where n is the complexity of the map. (Question: Why is the query time O(n)?)
S
q
A D E G F C B
3
Point in polygon queries revisited Point in polygon queries revisited
- Problem: preprocess a polygon to quickly answer
whether an input point is inside or outside.
- Special cases:
- Convex polygons
- Star shaped polygons
- Both processes in O(n) time and storage, query
time O(logn).
- What about monotone polygons?
4
Preprocessing monotone polygons Preprocessing monotone polygons
- Compute trapezoidal decomposition in O(n) time.
- Binary search for x-coordinate.
- Point is either in, above, or below trapezoid.
5
The slab method The slab method
- Draw vertical lines through
all the vertices of the subdivision.
- Store the x-coordinates of the
vertices in an ordered binary tree.
- Within each slab, sort the
segments separately along y.
- Query time: O(log n). Quick!
- Problem: Too delicate
subdivision, of size Θ(n2) in the worst case.
6