lecture 2b: subdivision representation and map …2 computational geometry lecture 2b: subdivision...

51
Motivation Doubly-connected edge list Map overlay Subdivision representation and map overlay Computational Geometry Lecture 2b: Subdivision representation and map overlay Computational Geometry Lecture 2b: Subdivision representation and map overlay 1

Upload: others

Post on 10-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

Subdivision representation and map overlay

Computational Geometry

Lecture 2b: Subdivision representation

and map overlay

Computational Geometry Lecture 2b: Subdivision representation and map overlay1

Page 2: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlayMap overlay

Map overlay

Map overlay is the combination oftwo (or more) map layers

It is needed to answer questions like:

What is the total length ofroads through forests?

What is the total area of cornfields within 1km from a river?

What area of all lakes occurs atthe geological soil type “rock”?

Computational Geometry Lecture 2b: Subdivision representation and map overlay2

Page 3: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlayMap overlay

Map overlay

To solve map overlay questions, weneed (at the least) intersectionpoints from two sets of line segments(possibly, boundaries of regions)

Computational Geometry Lecture 2b: Subdivision representation and map overlay3

Page 4: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlayMap overlay

Map overlay

To solve map overlayquestions, we also need to beable to represent subdivisions

clayclay sand

sandloess

rockrock

sand

sand

loess

clay

rock rock

clay

Computational Geometry Lecture 2b: Subdivision representation and map overlay4

Page 5: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Subdivisions

A planar subdivision is a structure induced by a set of linesegments in the plane that can only intersect at commonendpoints. It consists of vertices, edges, and faces

face

vertex

edge

Computational Geometry Lecture 2b: Subdivision representation and map overlay5

Page 6: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Subdivisions

Vertices are the endpoints of the linesegments

Edges are the interiors of the line segments

Faces are the interiors of connectedtwo-dimensional regions that do notcontain any point of any line segment

Objects of the same dimensionality areadjacent or not; objects of differentdimensionality are incident or not

adjacent

incident

Computational Geometry Lecture 2b: Subdivision representation and map overlay6

Page 7: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Subdivisions

Exactly one face is unbounded, theouter face

Every other face is bounded and hasan outer boundary consisting ofvertices and edges

Any face has zero or more innerboundaries

Computational Geometry Lecture 2b: Subdivision representation and map overlay7

Page 8: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Subdivisions

Vertices, edges, and faces form apartition of the plane

If a planar subdivision is induced byn line segments, it has exactly nedges, and at most 2n vertices

Computational Geometry Lecture 2b: Subdivision representation and map overlay8

Page 9: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Subdivisions

And how many faces?

Observe: Every face is bounded by atleast 3 edges, and every edge boundsat most 2 faces ⇒F ≤ 2E/3 = 2n/3 = O(n)

Computational Geometry Lecture 2b: Subdivision representation and map overlay9

Page 10: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Euler’s formula

Euler’s formula for planar graphs: If S is a planarsubdivision with V vertices, E edges, and F faces, thenV−E+F ≥ 2, with equality iff the vertices and edges of Sform a connected set

V = 9, E = 10, F = 4 V = 11, E = 13, F = 4

V − E + F = 3 V − E + F = 2

Computational Geometry Lecture 2b: Subdivision representation and map overlay10

Page 11: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Representing subdivisions

A subdivision representation has avertex-object class, an edge-objectclass, and a face-object class

It is a pointer structure whereobjects can reach incident (oradjacent) objects easily

Computational Geometry Lecture 2b: Subdivision representation and map overlay11

Page 12: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Representing subdivisions

Use the edge as the central object

For any edge, exactly two verticesare incident, exactly two faces areincident, and zero or more otheredges are adjacent

f1f2

v1

v2

Computational Geometry Lecture 2b: Subdivision representation and map overlay12

Page 13: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Representing subdivisions

Use the edge as the central object,and give it a direction

Now we can speak of Origin,Destination, Left Face, and RightFace

fleft

vorigin

fright

vdestination

Computational Geometry Lecture 2b: Subdivision representation and map overlay13

Page 14: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Representing subdivisions

Four edges are of specialinterest

fleftfright

for fright

for frightfor fleft

for fleft

next edgenext edge

previous edgeprevious edge

Computational Geometry Lecture 2b: Subdivision representation and map overlay14

Page 15: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Representing subdivisions

It would be nice if we could traversea boundary cycle by continuouslyfollowing the next edge for fleft orfright

. . . but, no consistent edgeorientation needs to exist

Computational Geometry Lecture 2b: Subdivision representation and map overlay15

Page 16: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

Representing subdivisions

We apply a trick/hack/impossibility:split every edge length-wise(!) intotwo half-edges

Every half-edge:

has exactly one half-edge as itsTwin

is directed opposite to its Twin

is incident to only one face (left)

~e Twin(~e)

Next(~e)

Prev(~e)

Computational Geometry Lecture 2b: Subdivision representation and map overlay16

Page 17: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

The doubly-connected edge list

The doubly-connected edge listis a subdivision representationstructure with an object forevery vertex, every half-edge,and every face

A vertex object stores:

Coordinates

IncidentEdge (somehalf-edge leaving it)

A half-edge object stores:

Origin (vertex)

Twin (half-edge)

IncidentFace (face)

Next (half-edge in cycleof the incident face)

Prev (half-edge in cycleof the incident face)

Computational Geometry Lecture 2b: Subdivision representation and map overlay17

Page 18: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

The doubly-connected edge list

A face object stores:

OuterComponent(half-edge of outer cycle)

InnerComponents (listof half-edges for the innercycles bounding the face)

f

Computational Geometry Lecture 2b: Subdivision representation and map overlay18

Page 19: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

The doubly-connected edge list

Question: A half-edge~e can directlyaccess its Origin, and get thecoordinates of one endpoint. Howcan it get the coordinates of its otherendpoint?

Question: For a vertex v, how do wefind all adjacent vertices?

v

~e Twin(~e)

Next(~e)

Prev(~e) Origin(~e)

Computational Geometry Lecture 2b: Subdivision representation and map overlay19

Page 20: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

The doubly-connected edge list

A vertex object stores:

Coordinates

IncidentEdge

Any attributes, mark bits

A face object stores:

OuterComponent(half-edge of outer cycle)

InnerComponents(half-edges for the innercycles)

Any attributes, mark bits

A half-edge object stores:

Origin (vertex)

Twin (half-edge)

IncidentFace (face)

Next (half-edge in cycleof the incident face)

Prev (half-edge in cycleof the incident face)

Any attributes, mark bits

Computational Geometry Lecture 2b: Subdivision representation and map overlay20

Page 21: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

SubdivisionsRepresenting subdivisionsDCEL structure

The doubly-connected edge list

Question: For a face f , how do we find all adjacent facenames, assuming they are stored in an attribute? Write thecode using the proper names like Next, OuterComponent,etc.

Computational Geometry Lecture 2b: Subdivision representation and map overlay21

Page 22: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Map overlay problem

The map overlay problem for twosubdivisions S1 and S2 is to computea subdivision S that is the overlay ofS1 and S2

All edges of S are (parts of) edgesfrom S1 and S2. All vertices of S arealso in S1 or S2, or intersections ofedges from S1 and S2

Computational Geometry Lecture 2b: Subdivision representation and map overlay22

Page 23: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Map overlay

We start by making a copy of S1 andof S2 whose vertex and half-edgeobjects we will re-use

At first we do not compute faceobject information in the overlay

The output should be adoubly-connected edge list (DCEL)of the overlay

Computational Geometry Lecture 2b: Subdivision representation and map overlay23

Page 24: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Map overlay

Approach: plane sweep

Need to define status, events, eventhandling

Need status structure, event list, andDCEL for the output

Computational Geometry Lecture 2b: Subdivision representation and map overlay24

Page 25: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Map overlay

Status: the edges of S1 and S2intersecting the sweep line in theleft-to-right order

Events happen:

At the vertices of S1 and S2

At intersection points from S1and S2

The event list is basically the sameas for line segment intersection

Computational Geometry Lecture 2b: Subdivision representation and map overlay25

Page 26: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Overlay events

Six types of events:

A vertex of S1

A vertex of S2

An intersection point of one edge fromS1 and one edge from S2

An edge of S1 goes through a vertexof S2

An edge of S2 goes through a vertexof S1

A vertex of S1 and a vertex of S2coincide

Computational Geometry Lecture 2b: Subdivision representation and map overlay26

Page 27: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Overlay events

Consider the event:an intersection point of one edge from S1 and one edgefrom S2

geometry DCELs before DCEL after

Computational Geometry Lecture 2b: Subdivision representation and map overlay27

Page 28: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Overlay events

Consider the event:an edge from S1 goes through a vertex of S2

geometry DCELs before DCEL after

Computational Geometry Lecture 2b: Subdivision representation and map overlay28

Page 29: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Overlay events

Consider the event:a vertex of S1 and a vertex of S2 coincide

geometry DCELs before DCEL after

Computational Geometry Lecture 2b: Subdivision representation and map overlay29

Page 30: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Overlay events

When we take an event from the event queue Q, we needquick access to the DCEL to make the necessary changes

We keep a pointer from each leaf in the status structure toone of the representing half-edges in the DCEL

Computational Geometry Lecture 2b: Subdivision representation and map overlay30

Page 31: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Overlay events

When we take an event from the event queue Q, we needquick access to the DCEL to make the necessary changes

We keep a pointer from each leaf in the status structure toone of the representing half-edges in the DCEL

Computational Geometry Lecture 2b: Subdivision representation and map overlay31

Page 32: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Overlay so far

The sweep algorithm gives us all vertices and half-edges of theoverlay, and pointers between these objects

Next we need face objects and their connection into thedoubly-connected edge list structure

Question: Which variables of vertex, edge, and face objectswill we set in this process?

Computational Geometry Lecture 2b: Subdivision representation and map overlay32

Page 33: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Computational Geometry Lecture 2b: Subdivision representation and map overlay33

Page 34: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Computational Geometry Lecture 2b: Subdivision representation and map overlay34

Page 35: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

C1

C2

C3C4C5

C6

C7

C8

C9

C10C11

C12

Computational Geometry Lecture 2b: Subdivision representation and map overlay35

Page 36: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Face information

Determine all cycles of half-edges, and whether they areinner or outer boundaries of the incident face

Make a face object for each outer boundary, plus one forthe unbounded face, and set the OuterComponentvariable of each face. Set the IncidentFace variable forevery half-edge in an outer boundary cycle

Computational Geometry Lecture 2b: Subdivision representation and map overlay36

Page 37: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

C1

C2

C3C4C5

C6

C7

C8

C9

C10C11

C12

Computational Geometry Lecture 2b: Subdivision representation and map overlay37

Page 38: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

C1

C2

C3C4C5

C6

C7

C8

C9

C10C11

C12

C6 → C2

C2 → C5

C1 →C3 →

C10 → C1

C7 → C9

Computational Geometry Lecture 2b: Subdivision representation and map overlay38

Page 39: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Face information

Determine the leftmost vertex of each inner boundarycycle

For all of these leftmost vertices, determine the edgehorizontally left of it, take the downward half-edge of it,and its cycle (by plane sweep) to set InnerComponentsfor all faces and IncidentFace for half-edges in innerboundary cycles

Computational Geometry Lecture 2b: Subdivision representation and map overlay39

Page 40: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

C1

C2

C3C4C5

C6

C7

C8

C9

C10C11

C12

C6 → C2

C2 → C5

C1 →C3 →

C10 → C1

C7 → C9

f5

f5: outer e5; inner e2, e6

e5

e2

e6

Computational Geometry Lecture 2b: Subdivision representation and map overlay40

Page 41: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Efficiency

Every event takes O(logn) or O(m+ logn) time to handle,where m is the sum of the degrees of any vertex from S1and/or S2 involved

The sum of the degrees of all vertices is exactly twice thenumber of edges in the output

Theorem: Given two planar subdivisions S1 and S2, theiroverlay can be computed in O(n logn+ k logn) time, where kis the number of vertices of the overlay

Computational Geometry Lecture 2b: Subdivision representation and map overlay41

Page 42: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Boolean operations on polygons

Boolean operations on twopolygons with n vertices takeO(n logn+ k logn) time, wherek is the number of intersectionpoints

intersection

symmetric difference

union

difference or

Computational Geometry Lecture 2b: Subdivision representation and map overlay42

Page 43: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Placement space of a square

Given a set of n points in the plane, and a side length s,compute an axis-parallel placement of a square S with sidelength s such that it contains the maximum number of points.

s

S

Computational Geometry Lecture 2b: Subdivision representation and map overlay43

Page 44: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Placement space of a square

Given a set of n points in the plane, and a side length s,compute an axis-parallel placement of a square S with sidelength s such that it contains the maximum number of points.

s

S

Computational Geometry Lecture 2b: Subdivision representation and map overlay44

Page 45: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Placement space of a square

The parts of a subdivision intersecting a fixed-size squarewhen that square can be placed anywhere is the overlay offour copies of the subdivision and n copies of the square

Computational Geometry Lecture 2b: Subdivision representation and map overlay45

Page 46: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Placement space of a square

The parts of a subdivision intersecting a fixed-size squarewhen that square can be placed anywhere is the overlay offour copies of the subdivision and n copies of the square

Computational Geometry Lecture 2b: Subdivision representation and map overlay46

Page 47: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Placement space of a square

The parts of a subdivision intersecting a fixed-size squarewhen that square can be placed anywhere is the overlay offour copies of the subdivision and n copies of the square

Computational Geometry Lecture 2b: Subdivision representation and map overlay47

Page 48: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Placement space of a square

The parts of a subdivision intersecting a fixed-size squarewhen that square can be placed anywhere is the overlay offour copies of the subdivision and n copies of the square

Computational Geometry Lecture 2b: Subdivision representation and map overlay48

Page 49: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Computational Geometry Lecture 2b: Subdivision representation and map overlay49

Page 50: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Computational Geometry Lecture 2b: Subdivision representation and map overlay50

Page 51: Lecture 2b: Subdivision representation and map …2 Computational Geometry Lecture 2b: Subdivision representation and map overlay Motivation Doubly-connected edge list Map overlay

MotivationDoubly-connected edge list

Map overlay

InitializationOverlay algorithmBoolean operations, placement space

Summary

Computing the overlay of two subdivisions, or the placementspace of a shape, is a basic operation needed in GIS

To represent a planar subdivision, a doubly-connected edgelist is a convenient data structure

To design efficient geometric algorithms, the plane sweeptechnique is often a good choice

Computational Geometry Lecture 2b: Subdivision representation and map overlay51

Unknown
How do you traverse all edges incident to a vertex?