Professional Documents
Culture Documents
Geometric Algorithms: Quadtrees
Geometric Algorithms: Quadtrees
Quadtrees
Geometric Algorithms
Lecture 9: Quadtrees
VLSI Design
http://www.antics1.demon.co.uk/finelms.html
Meshes
Meshes
not conforming
component
not well-shaped
doesn’t respect input
Meshes
0
0 U
Meshes
Steiner points
uniform non-uniform
Quadtrees
Quadtree: a rooted tree in which every node has 4 children
each node corresponds to a square in the plane
each child of a node corresponds to a quadrant of the
square of the node
a quadtree induces a subdivision of the square of the root
NE NW SW SE
Quadtree Examples
http://donar.umiacs.umd.edu/quadtree/, in particular
http://donar.umiacs.umd.edu/quadtree/points/prquad.html
http://www.maptiler.org/
google-maps-coordinates-tile-bounds-projection/
Constructing a Quadtree
Constructing a Quadtree
Unbalanced Quadtrees
Side lengths
depth = 3
s
Properties
Finding a Neighbor
Balanced Quadtrees
Balancing a Quadtree
add nodes!
balancing
Input: quadtree T
Output: balanced version of T
1. insert all leaves of T into a linear list L
2. while L is not empty
3. do remove a leave µ from L
4. if σ(µ) has to be split
5. then make µ an internal node with 4 children;
if µ stores a point, store it in the correct leave
6. insert the 4 new leaves into L
7. check if σ(µ) had neighbors that now need to be split,
and if so, insert them into L
8. return T
build a quadtree:
split until no object intersects a square
or square has size 1 × 1
this gives small squares at objects,
(and larger ones further away)
an object completely in the square and even a single point of
intersection count as intersections!