Geoinformation II (6. Semester)

Slides:



Advertisements
Ähnliche Präsentationen
Kap. 13 Sweep-Line Algorithmen Kap Schnittprobleme
Advertisements

Christian Scheideler SS 2009
WS 03/041 Algorithmentheorie 01 - Einleitung Prof. Dr. S. Albers Prof. Dr. Th. Ottmann.
WS Algorithmentheorie 01 – Divide and Conquer (Segmentschnitt) Prof. Dr. Th. Ottmann.
Vorlesung Informatik 2 Algorithmen und Datenstrukturen (27 – Kürzeste Wege) Prof. Th. Ottmann.
WS 06/07 Algorithmentheorie 01 - Einleitung Prof. Dr. Th. Ottmann Tobias Lauer.
Geometrisches Divide and Conquer
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation II Vorlesung Foliendesign: cand. geod. Jörg Steinrücken.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Übung Diskrete Mathematik SS 2003 Segmentschnitt I.
Institut für Kartographie und Geoinformation Dipl.-Ing. J. Schmittwilken Diskrete Mathe II Übung
Institut für Kartographie und Geoinformation Dipl.-Ing. J. Schmittwilken Diskrete Mathe II Übung
Institut für Kartographie und Geoinformation Dipl.-Ing. J. Schmittwilken Diskrete Mathe II Übung
Diskrete Mathematik I Vorlesung 9b AVL-Baum, Algorithmen.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik I Vorlesung Listen-
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation II Vorlesung In welcher Masche liegt der Punkt p?
Theorie und Praxis geometrischer Algorithmen
Punktbeschriftung mit vier Rechtecken gleicher Höhe (Anzahlmaximierung) Julia Löcherbach.
BSP Binary Space Partitioning
Diskrete Mathe 9 Vorlesung 9 SS 2001
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 1 SS 2001 Algorithmus von Dijkstra.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation I Vorlesung 5 WS 2000/2001 Topologie, Landkarten, Datenstrukturen.
Datenstrukturen für Landkarten
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation I Vorlesung 14 WS 2000/2001 Gerhard Gröger ArcToolbox - Konvertierung.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation I Vorlesung 13 WS 2000/2001 Gerhard Gröger Analyse.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation I Vorlesung 12 WS 2000/2001 Gerhard Gröger Modellierung mit Geodatabases.
Diskrete Mathematik II
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation II Vorlesung 8 SS 2000 Punkt-in-Polygon-Verfahren II (Trapezkarte)
Geoinformation II Vorlesung 2 SS 2001 AVL-Bäume.
Geoinformation II Vorlesung 4 SS 2001 Voronoi-Diagramme.
Modellierung des Raumes
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Objektorientierte Konzepte/UML Geoinformation I Vorlesung 2 WS 2000/2001.
Konstruktion der Voronoi-Diagramme II
Geoinformation II Vorlesung 3 SS 2001 Polygon Overlay.
Diskrete Mathematik II
Diskrete Mathematik II
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 5 SS 2001 Segmentschnitt II (n Segmente)
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation II Vorlesung 7 SS 2000 Punkt-in-Polygon-Verfahren I (Trapezkarte)
Konstruktion der Voronoi-Diagramme I
Überlagerungsgesetz - Uq – Uq –– uq ~m Uq –+ uq ~m V-105.

Eine lllustration der Herausforderungen des Stromsystems der Zukunft
Vorlesung Mai 2000 Konstruktion des Voronoi-Diagramms II
Gegenseitige Lage von Geraden Schnittpunktberechnung
Folie Beispiel für eine Einzelauswertung der Gemeindedaten (fiktive Daten)
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation III Vorlesung 1 WS 2001/02 Punkt-in-Landkarte I (Streifenkarte)
Diskrete Mathematik II
Korrektheit von Programmen – Testen
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 6 SS 2001 Segmentschnitt III.
Diskrete Mathematik II
Folie Einzelauswertung der Gemeindedaten
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation II 6. Sem. Vorlesung Mai 2000 Konstruktion des Voronoi-Diagramms.
Landkarten Landkarten sind Tesselationen mit folgenden Eigenschaften:
Diskrete Mathe II Übung
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Foliendesign: Jörg Steinrücken & Tobias Kahn Vorlesung
Vorlesung Einführendes Beispiel-
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung der Algorithmus von Floyd Foliendesign:
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation II 6. Sem. Vorlesung April 2000 AVL-Bäume.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung Datenstrukturen für den Algorithmus von.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Foliendesign: Jörg Steinrücken & Tobias Kahn Vorlesung
Diskrete Mathe II Übung IKG - Übung Diskrete Mathe II – Jörg Schmittwilken 2 Übung5 Prüft, ob sich folgende Segmente schneiden: –P1(1/7) P2(3/1)
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation II Vorlesung 4 WS 01/02 Quadtrees.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung Suche des kürzesten Weges in einem Netz.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Foliendesign: Jörg Steinrücken & Tobias Kahn Vorlesung
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung Voronoi-Diagramme.
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung der Algorithmus von Floyd.
Geoinformation II 6. Sem. Vorlesung April 2000 Geometrische Algorithmen - ein einführendes, größeres Beispiel für ein Semester-begleitendes Programmier.
Institut für Kartographie und Geoinformation Dipl.-Ing. J. Schmittwilken Diskrete Mathe II Übung
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Geoinformation II 6. Sem. Vorlesung 4 4. Mai 2000 Voronoi-Diagramm.
Vorlesung April 2000 Polygon Overlay
Diskrete Mathematik II
 Präsentation transkript:

Geoinformation II (6. Semester) Vorlesung 1 SS 2001 Scan-Line-Verfahren

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Übersicht I Übersicht über das Semester Organisation Overlay n-Segment-Schnitt Zur Erinnerung („Diskrete Mathematik“) Groß-Oh-Notation Wachstum Hinreichende Bedingung für Schnittfreiheit Scan-Line-Verfahren Idee Gegenbeispiel Nachbarschaft Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Übersicht II Verfeinerung des Algorithmus Ordnungsrelation „x <‘‘ Ordnung der Segmente durch die Scan-Line Verwaltung der aktiven Elemente Wann wird der Schnittpunkt S1 erkannt? Vereinfachende Annahmen Algorithmus Scan-Line Algorithmus II Prüfung auf Schnittfreiheit Segmentschnitt I Segmentschnitt II Einfacher Segmentschnitt I Einfacher Segmentschnitt II Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Übersicht über das Semester was ist „GIS 2“? Funktionen von GIS Algorithmen in GIS effiziente Berechnung Speicherung räumlicher Objekte in GIS effiziente Suche GIS 1 = Modelle für GIS Welt  Modell GIS 2 = Modell  Rechner 2 große Algorithmen Overlay von Netzen und Flächen (Segmentschnitt) räumliche Nachbarschaft Voronoi-Diagramm, Delaunay- Triangulation Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Motivation: Overlay von Flächen und Landkarten von Netzen: Fluß und Straßennetz: Brücken Straßen und Eisenbahnnetz: Brücken, Tunnel Problem: Schnitt von n geraden Linien-Segmenten von Landkarten (polygonalen Strukturen) PLZ und Verkaufsbezirke Gemeinden und Geologie Problem: Segmentschnitt + Polygonkonstruktion heute nur: Schnitt von n Segmenten Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 n-Segment-Schnitt einfaches Vorgehen: paarweiser Vergleich:  s  S:  s‘ S - {s} überprüfe s und s‘ auf Schnittfreiheit und bestimme ggf. den Schnitt von s und s‘ Laufzeit: O(n2) für die Praxis viel zu langsam Ziel: O(n * log n) harter und langer Kampf! erste Idee: betrachte horizontale Projektionen Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Zur Erinnerung („Diskrete Mathematik“) Groß-Oh-Notation Definition: wobei Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Groß-Oh-Notation Beispiele: Inklusion: O(1)  O(log n)   O(n)   O(n log n)   O(n2)   O(n3)   ...  O(exp n)   Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Wachstum n² n log n Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Hinreichende Bedingung für Schnittfreiheit notwendig für Schnitt: Überlappung der horizontalen Projektionen Reduktion einer 2-dimensionalen auf eine 1-dimensionale Fragestellung Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Idee: horizontale Scan-Line über die Ebene schieben aktive Elemente: Schnitt mit der Scan-Line nur aktive Elemente können horizontale Überschneidungen haben überprüfe aktive Elemente auf Schnittfreiheit Problem: wo sind die Haltepunkte der Scan-Line Anfangspunkt eines Segments Endpunkt eines Segments geordnete Menge der x-Koordinaten Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren F B S2 S3 C S4 D A S1 E Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Scan-Line-Verfahren A B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Gegenbeispiel zu viele Elemente gleichzeitig aktiv  O(n2) Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Nachbarschaft A e-Umgebung B Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verfeinerung des Algorithmus nur benachbarte Segmente betrachten wie erkennt man sehr schnell, ob zwei Segmente benachbart sind? Nutzung der Scan-Line Betrachte die Schnittpunkte der aktiven Segmente mit der Scan-Line Nachbarschaft ergibt sich aus der Lage der Schnittpunkte Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Ordnungsrelation „x <‘‘ B A C x x‘ Ax < B Ax < C Cx < B Cx‘ < A Ax‘ < B Cx‘ < B Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Ordnung der Segmente durch die Scan-Line x< ist eine dynamische (!) Ordnung ... die nur auf der Menge der aktiven Elemente definiert ist die Ordnung x< zwischen zwei Elementen wird an ihren Schnittpunkten umgedreht aus a x< b wird am Schnittpunkt s von a und b b x< a liefert eine vollständige eindimensionale Ordnung der aktiven Segmente ... ... für jeden Haltepunkt der Scan-Line ! Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 A Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 A E Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente F B S2 S3 C S4 D A S1 E B E A Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 B D A E Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 B C A D E Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 B D C E Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente F B S2 S3 C S4 D A S1 E B E C D Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 F C B E D Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 B C F E D Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 B C F E Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 C E F Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 C F E Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 C Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Verwaltung der aktiven Elemente B F C D E S1 S3 S2 S4 Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Wann wird der Schnittpunkt S1 erkannt? B S1 C Übung: Wird ein Schnittpunkt stets genau einmal erkannt? Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Vereinfachende Annahmen 2 Segmente schneiden sich höchstens in einem Punkt in keinem Punkt schneiden sich mehr als 3 Segmente die x-Koordinaten aller Segmente sind paarweise verschieden kein Segment ist vertikal Gegenbeispiel Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Algorithmus Scan-Line Input: S: eine Menge von Segmenten Output: die Schnittpunkte der Elemente von S Sei T = Endpunkte der Segmente von S nach x-Koordinaten sortiert (Haltepunkte) L =  // aktive Segmente von S while T   do bestimme und entferne den nächsten Punkt pT x ist x-Koordinate von p case: p ist linker Endpunkt von s fuege_ein(s,x,L) sl = vorgaenger(s,x,L) sr = nachfolger(s,x,L) schnitt(sl,s,T); schnitt(s,sr,T); p ist rechter Endpunkt von s sl = vorgaenger(s,x,L) sr = nachfolger(s,x,L) entferne(s,x,L) schnitt(sl,sr,T) p ist Schnittpunkt von s und t vertausche(s,t,L,x) // t < s sl = vorgaenger(t,x,L) sr = nachfolger(s,x,L) schnitt(sl,t,T) schnitt(s,sr,T) Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Algorithmus II fuege_ein(s,x,L): fügt das Segment s in die Menge L ein entsprechend der Ordnung an der Stelle x entferne(s,x,L): entfernt das Segment s aus die Menge L an der Stelle x nachfolger(s,x,L): liefert den Nachfolger von s in L an der Stelle x, falls vorhanden vorgaenger(s,x,L) liefert den Vorgänger von s in L an der Stelle x, falls vorhanden schnitt(s,t,T) prüft s und t auf Schnitt. Berechnet ggf. den Schnittpunkt p und fügt ihn als neuen Haltepunkt in T ein. offene Probleme: eine geeignete Datenstruktur für T eine geeignete Datenstruktur für L Prüfung auf Schnitt, Berechnung des Schnittpunkts Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Prüfung auf Schnittfreiheit 1. Idee Berechnung der Geradengleichungen g und g‘ der Segmente s und s‘ Schnittpunkt p von g und g‘ prüfe ob p in s und s‘ Problem vertikale Segmente Vermeidung unangenehmer Sonderfälle Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Segmentschnitt I g1 g2 a) g1 g2 c) g2 g1 b) Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1 Segmentschnitt II Reduktion auf das Problem P1, P2 liegen auf der gleichen / verschiedenen Seiten der durch g induzierten Geraden Homogene Koordinaten: P1=(x1,y1,w1) P2=(x2,y2,w2) P=(x,y,w) D > 0 D = 0 P P2 P1 D < 0 s Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Einfacher Segmentschnitt I P2 P1 P3 P4 P2 P3 P4 P1 g g` P2 P1 P3 P4 S1 = det ( P1,P3,P4) Def.: Vor.: Alle Determinanten sind  0: S2 = det ( P3,P1,P2) g und g` schneiden sich genau dann, wenn S1, S2 S3 = det ( P2,P3,P4) sowie S3, S4 jeweils verschiedene Vorzeichen S4 = det ( P4,P1,P2) haben. Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1

Einfacher Segmentschnitt II Wenn alle Determinanten gleich Null sind, dann folgt daraus, daß alle vier Punkte kollinear sind. - eine Determinante ist Null: => Algorithmus: Einsparen von Multiplikationen Lutz Plümer - Geoinformation - 6. Semester - SS 2001 - Vorlesung 1