Spatial Information Systems (SIS) COMP 30110 Terrain modeling and geometric problems (part 2)

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Polygon Triangulation
Computational Geometry
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
Polygon overlay in double precision arithmetic One example of why robust geometric code is hard to write Jack Snoeyink & Andrea Mantler Computer Science,
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
algorithms and data structures
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Overlay of Two Subdivisions
Computational Geometry
1 Closest Points A famous algorithmic problem... Given a set of points in the plane (cities in the U.S., transistors on a circuit board, computers on a.
Spatial Information Systems (SIS)
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
November 4, Algorithms and Data Structures Lecture XIV Simonas Šaltenis Nykredit Center for Database Research Aalborg University
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
N Line Segments Problem Given a set of n line segments in the plane, determine whether or not any intersection exists. It is not required to output all.
Klee’s Measure Problem Computational Geometry, WS 2007/08 Group Work Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen, Institut.
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
I/O-Algorithms Lars Arge Aarhus University February 27, 2007.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
Spatial Information Systems (SIS) COMP Spatial queries and operations.
Special Cases of the Hidden Line Elimination Problem Computational Geometry, WS 2007/08 Lecture 16 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
Spatial Information Systems (SIS) COMP Terrain modeling and geometric problems.
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
Hidden-Line Elimination Computational Geometry, WS 2006/07 Lecture 14 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
UNC Chapel Hill M. C. Lin Overview of Last Lecture About Final Course Project –presentation, demo, write-up More geometric data structures –Binary Space.
Closest Pair of Points Computational Geometry, WS 2006/07 Lecture 9, Part II Prof. Dr. Thomas Ottmann Khaireel A. Mohamed Algorithmen & Datenstrukturen,
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Sorting Chapter 12 Objectives Upon completion you will be able to:
GI Systems and Science January 23, Points to Cover  What is spatial data modeling?  Entity definition  Topology  Spatial data models Raster.
Orthogonal Line Segment Intersection Given N horizontal and N vertical line segments, find all intersections. All x and y coordinates are distinct.
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
Preparing Data for Analysis and Analyzing Spatial Data/ Geoprocessing Class 11 GISG 110.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Open Problem: Dynamic Planar Nearest Neighbors CSCE 620 Problem 63 from the Open Problems Project
Sorting and Searching. Selection Sort  “Search-and-Swap” algorithm 1) Find the smallest element in the array and exchange it with a[0], the first element.
CMPS 3130/6130 Computational Geometry Spring 2015
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
Computational Geometry: Intersection Search Joseph S. B. Mitchell Stony Brook University.
ALGORITHMS.
C++ How to Program, 7/e © by Pearson Education, Inc. All Rights Reserved.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 O’Rourke Chapter 6 with some material.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry
MA/CSSE 473 Day 13 Finish Topological Sort Permutation Generation
CMPS 3130/6130 Computational Geometry Spring 2017
Query Processing in Databases Dr. M. Gavrilova
Algorithm design techniques Dr. M. Gavrilova
Computational Geometry Capter:1-2.1
Polygon Triangulation
Insertion Sort Demo Sorting problem:
Kinetic Collision Detection for Convex Fat Objects
Algorithms and Data Structures Lecture XIV
Presentation transcript:

Spatial Information Systems (SIS) COMP Terrain modeling and geometric problems (part 2)

Visibility Problems GIS query: “Is an entity located on the terrain visible from a given viewpoint?” Geometric problem: Intersection of lines andsurfaces Geometric problem: Intersection of lines and surfaces

Segment intersection problem: given a set of segments in the plane, calculate their intersections Segment intersection problems arise in several different contexts (example: map overlay, clipping in GIS and computer graphics, etc.) Segment intersection algorithms

Test all possible pairs of segments For a set of N segments: N (N-1) intersection tests 2 2 Time complexity O(N 2 ) Brute force algorithm

Exploits the so-called plane sweep technique We consider a straight line (called sweep line) that sweeps the plane In general, it is a vertical line that proceeds from left to right and stops at certain “events” This line partitions the plane into a left and a right half plane Bentley Ottmann Algorithm (1979)

Based on the fact that the set of intersections of N segments in the plane is the union of intersections that occur in the left half plane and of intersections that occur in the right half plane Bentley Ottmann Algorithm (cont.d)

Also based on the fact that in order for two segments to intersect, their respective intersections with the sweep line must become at some stage adjacent (e.g., s1 and s2) Bentley Ottmann Algorithm (cont.d) s1 s2

Event points: segment endpoints and intersections The intersection of the sweep line with the input segments contains all relevant information Two basic data structures: - event point schedule - sweep line status Bentley Ottmann Algorithm (cont.d)

Event point schedule: a sequence of x values ordered from left to right, defining the positions at which the sweep line will stop This is a dynamic structure as it is not entirely defined by the input data: it will be updated as intersection points are being found Bentley Ottmann Algorithm (cont.d)

Sweep line status: contains information about the intersections of the sweep line and the input segments This is a also dynamic structure being updated at each event point Bentley Ottmann Algorithm (cont.d)

Order relation between segments: Consider two non-intersecting segments s1 and s2 s1 and s2 are said to be comparable at abscissa x 0 if the vertical line x = x 0 intersects both s1 and s2 Bentley Ottmann Algorithm (cont.d) s1 s2 x = x 0

s1 is said to be above s2 at x 0 and indicated: s1 > x0 s2 if s1 and s2 are comparable at x 0 and the intersection of s1 with the vertical line x = x 0 is above the intersection of s2 with the vertical line x = x 0 Bentley Ottmann Algorithm (cont.d) s1 s2 x = x 0

As the vertical line moves from left to right the order relation between the segments changes. Segments can enter or leave the ordering as they may intersect or not the sweep line at a given value x The ordering will change only when: - the left endpoint of a segment is encountered (then the segment is added to the ordering) (then the segment is added to the ordering) - the right endpoint of a segment is encountered (then the segment is removed from the ordering) (then the segment is removed from the ordering) - an intersection point between two segments is encountered (then the two segments must exchange place in the ordering) (then the two segments must exchange place in the ordering) Bentley Ottmann Algorithm (cont.d)

s1 s2 s3 s1 added to the sweep line status s1 removed from the sweep line status s2 and s3 exchanged in the sweep line status

Bentley Ottmann Algorithm (cont.d) The sweep line status is a description of the relation > x0 i.e. it is a sequence of segments. The operations we perform on the sweep line status are: - Insertion - Deletion - Retrieve the segment immediately above or below a given segment in the sweep line status These operations should be performed efficiently (i.e., in time at most logarithmic in the number of segments contained in it)

Bentley Ottmann Algorithm (cont.d) The event point schedule contains all event points: - segment endpoints (known a priori) and - intersection points (calculated dynamically) Intersection points are not necessarily being processed as events at the time they are detected. It might be necessary to process other events before. p s1 s2 s3 Example:

Bentley Ottmann Algorithm (cont.d) The event point schedule should support the following operations efficiently (i.e. in logarithmic time): -Retrieve the smallest element in it - Insertion - Membership

Bentley Ottmann Algorithm (cont.d) Algorithm: Sort the endpoints of the input segments in lexicographic order by x and y and insert them in the event point schedule As the sweep line sweeps the plane, update the sweep line status at each event and test all segments that become adjacent for intersection If an intersection is detected for the first time, report the intersection and insert its abscissa into the event point schedule

Bentley Ottmann Algorithm (cont.d) No intersection is missed as all pairs of adjacent segments are correctly examined Complexity: O((n + k) log n) Where n is the number of segments and k is the number of intersections that occur among the n segments Intuitively: we have O(n+k) events and at each event we perform a constant number of operations that require logarithmic time (assuming that we use data structures that support operations in at most logarithmic time)

Summary Terrain modeling: polyhedral models (e.g. TINs) and gridded elevation models (RSGs) Examples of geometric problems associated with DTMs: - triangulation calculation (Watson’s algorithm) - intersection problems arising for example during visibility calculations (Bentley-Ottmann algorithm) An interesting reseach topic: multiresolution models (generate models using larger/smaller datasets and with different associated approximation errors)