polyline simplification l.
Skip this Video
Loading SlideShow in 5 Seconds..
Polyline Simplification PowerPoint Presentation
Download Presentation
Polyline Simplification

Loading in 2 Seconds...

play fullscreen
1 / 36

Polyline Simplification - PowerPoint PPT Presentation

  • Uploaded on

Polyline Simplification. Finally, a Topologically Consistent Algorithm!!. Alan Saalfeld The Ohio State University. What is Polyline Simplification?. A polyline is a connected non-self-intersecting path in the plane made up of line segments

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Polyline Simplification' - akina

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
polyline simplification

Polyline Simplification

Finally, a Topologically

Consistent Algorithm!!

Alan Saalfeld

The Ohio State University

what is polyline simplification
What is Polyline Simplification?
  • A polyline is a connected non-self-intersecting path in the plane made up of line segments
  • Simplification involves replacing the original polylines with polylines of fewer segments
  • Restrictions are placed on the replacement polylines:
    • Each should be “close” to the original polyline
    • All should preserve “sidedness” (topology)
it all boils down to replacing a sub polyline with a line segment



It all boils down to replacing a sub-polyline with a line segment



Areas inverted by replacing a

subpolyline Pij by a single segment eij

what makes simplification hard
What makes simplification hard?
  • Not nearness constraints (that’s easy!!)
    • Douglas-Peucker algorithm (1973)--our model!
    • Many other algorithms work on isolated lines
  • Topological conflicts can be hard to detect
    • End-point representation of vectors hinders one’s ability to quickly recognize potential feature conflicts
    • Conflicting points change as the algorithm runs: alleviating one conflict can result in another!
    • Don’t want to have to check all possible interactions (O(n2)) at every stage of the process
testing for topological changes
Testing for topological changes



Straight line approximation

sidedness for the straight line segment
Sidedness for the straight line segment

Below the line

Above the line

sidedness for the polyline
Sidedness for the polyline

Below the polyline

Above the polyline

sidedness differences

Above both lines

Above one line,

below the other

Below both lines

Sidedness differences
testing for topological correctness
Testing for topological correctness
  • A same-sidedness test is identical to inside/outside testing for polygons: namely, determine the parity (odd or even) of the number of crossings (of both the polyline and the simplifying segment) of any ray (vertical is easy) emanating from the test point
what topological problems arise
What topological problems arise?
  • Polylines “move” when the simplified version replaces the original version
    • Labeled points wind up on the wrong side of the replacement polyline
    • Simplified polylines cross other polylines
    • A simplified polyline may even cross itself
the douglas peucker algorithm
The Douglas-Peucker Algorithm
  • Recursive procedure:
    • Asks “Does a single segment adequately (i.e., within e) represent the current sub-polyline?”
    • If not, then two segments are chosen, each representing a smaller sub-polyline; and each of them gets asked the same question.
the douglas peucker algorithm20
The Douglas-Peucker Algorithm
  • Key properties:
    • We examine one polyline at a time.
    • A subset of vertices are chosen.
    • Vertices are added one at a time and never removed from the growing simplified polyline (a greedy algorithm).
    • Each new candidate vertex lies on the convex hull of the sub-polyline currently under consideration for being approximated by a single segment.
    • The new candidate vertex is unique up to ties in distance.
    • Each recursive call is a “whole new ballgame”.
hull lemma i
Hull Lemma I
  • Any conflicts with the simplified polyline must occur within the closed convex hull of the original polyline.
    • Proof: Vertices of the simplified polyline form a subset of polyline vertices; a line segment joining two points in a convex region remains entirely inside the convex region.
hull lemma ii
Hull Lemma II
  • Any line passing completely through the hull must cross the original polyline that generated the hull.
corollary i to hull lemmas i ii
Corollary I to Hull Lemmas I & II
  • Any line segment that intersects the simplified version, but does not intersect the original polyline, must have at least one end point inside the convex hull of the original polyline.
corollary ii to hull lemmas i ii
Corollary II to Hull Lemmas I & II
  • We need only examine the topological correctness of “foreign” point features (including shape points and segment endpoints) lying within the convex hull of the current sub-polyline being represented by a single line segment.
another way to look at it



Another way to look at it:
  • What changes if we represent the polyline by two line segments instead of by a single line segment?
  • Replacing a line segment by two segments toggles the topological correctness or incorrectness of all points inside the triangle (and only those points).

Effect of replacing sub-polyline by a single segment

Points stay on same side(+)

Points change side(-)


Effect of replacing sub-polyline by two segments

Points change side (-)

Points stay on same side (+)


Effect of replacing a single segment simplification with two segments

Points keep relative orientation:



Points change relative orientation:

(same to different or vice versa)

convergence results
Convergence results
  • Nested subhulls give us ever smaller regions in which to search for conflicts
  • The set of potentially conflicting points decreases with each iteration, except for original polyline points that may conflict with other sub-polylines
  • One may always achieve correct topology with enough iterations
hull lemma iii
Hull Lemma III
  • Vertices appear in order on both the upper hull and the lower hull

Convex hull generation

12 (Pop CW section back to “2”

Push “12” onto both sections)






12 (Pop both sections:

Pop CW section back to “5”;

Pop C-CW section back to “9”;

Push “12” onto both sections)







12 (Pop C-CW section back to “2”;

Push “12” onto both sections)

A double-ended queue (deque): 11, 9, 7, 1, 2, 4, 5, 6, 11

Current clockwise (CW) section: 1, 2, 4, 5, 6, 11

Current counter-clockwise (C-CW) section: 1, 7, 9, 11

detecting self intersections
Detecting self-intersections
  • A potential conflict exists when subhulls overlap
  • Subhulls overlap if and only if the right subhull starts off to the left of the left subhull. In that case, at least one subhull must contain points of the other subhull’s polyline.
our basic algorithm
Our Basic Algorithm
  • Run Douglas-Peucker to get segments that approximate each sub-polyline to within e
  • On each resulting segment find the sub-polyline’s hull and identify any external points in that hull
  • Classify all external points by “sidedness”
  • Continue Douglas-Peucker, adding nodes until:
    • All sidedness is correct (including any “new” external points from other portions of the sub-polyline)
      • (Change “sidedness” flag in one triangle at a time)
    • Furthest node is within e
what s next
What’s next?
  • Write code to apply our basic algorithm to real data from NOAA, USGS, and NIMA.
  • Determine performance in terms of:
    • Number of extra points required to fix topology.
    • Aesthetic considerations of polylines generated.
    • Effects due to choices made (e.g., contours).
  • Look at possible alternatives to our basic algorithm.
variants on the basic algorithm
Variants on the Basic Algorithm
  • Change the next-point selection criterion from “furthest point” to something else (The condition that the selected point belong to the hull may no longer hold.)
  • Correct “sidedness” problems first, then apply the e-threshold constraint
  • Choose the next point from among interior points of segments of the polyline (This requires adding vertices to the polyline without changing its trace.)
  • Examine algorithms that do not subsample vertices