Week Aug-17 – Aug-22 Introduction to Spatial Computing CSE 5ISC Some slides adapted from Worboys and Duckham (2004) GIS: A Computing Perspective, Second.

Slides:



Advertisements
Similar presentations
Approximations of points and polygonal chains
Advertisements

Advanced Topics in Algorithms and Data Structures Lecture 7.2, page 1 Merging two upper hulls Suppose, UH ( S 2 ) has s points given in an array according.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
Visibility Graph Team 10 NakWon Lee, Dongwoo Kim.
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.
Computing Convex Hulls CLRS 33.3
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
The Divide-and-Conquer Strategy
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 6 Ack : Carola Wenk nad Dr. Thomas Ottmann tutorials.
Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.
Fractional Cascading CSE What is Fractional Cascading anyway? An efficient strategy for dealing with iterative searches that achieves optimal.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
17. Computational Geometry Chapter 7 Voronoi Diagrams.
2. Voronoi Diagram 2.1 Definiton Given a finite set S of points in the plane , each point X of  defines a subset S X of S consisting of the points of.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Computational Geometry and Spatial Data Mining
Delaunay Triangulation Computational Geometry, WS 2006/07 Lecture 11 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
1.4 Exercises (cont.) Definiton: A set S of points is said to be affinely (convex) independent if no point of S is an affine combination of the others.
Lecture 10 : Delaunay Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Overview Motivation. Triangulation of Planar Point Sets. Definition.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Computing the Delaunay Triangulation By Nacha Chavez Math 870 Computational Geometry; Ch.9; de Berg, van Kreveld, Overmars, Schwarzkopf By Nacha Chavez.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Data Input How do I transfer the paper map data and attribute data to a format that is usable by the GIS software? Data input involves both locational.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
Slope and Aspect Calculated from a grid of elevations (a digital elevation model) Slope and aspect are calculated at each point in the grid, by comparing.
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.
Week Aug-10 – Aug-15 Introduction to Spatial Computing CSE 5ISC Some slides adapted from Worboys and Duckham (2004) GIS: A Computing Perspective, Second.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
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.
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
 Trace the incremental algorithm for constructing convex data on the sample point data given below. Intermediate steps should be shown First, two steps.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
Introduction to Computational Geometry Hackson
Fundamental Data Structures and Algorithms Klaus Sutner April 27, 2004 Computational Geometry.
On Graphs Supporting Greedy Forwarding for Directional Wireless Networks W. Si, B. Scholz, G. Mao, R. Boreli, et al. University of Western Sydney National.
1 Spatial Data Models and Structure. 2 Part 1: Basic Geographic Concepts Real world -> Digital Environment –GIS data represent a simplified view of physical.
Algorithms 1.Notion of an algorithm 2.Properties of an algorithm 3.The GCD algorithm 4.Correctness of the GCD algorithm 5.Termination of the GCD algorithm.
1 / 41 Convex Hulls in 3-space Jason C. Yang. 2 / 41 Problem Statement Given P: set of n points in 3-space Return: –Convex hull of P: CH (P) –Smallest.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Polygon Triangulation
Computational Geometry
Applied Discrete Mathematics Week 2: Functions and Sequences
Introduction to Spatial Computing CSE 555
Physical Structure of GDB
Introduction to Polygons
Fill Area Algorithms Jan
Convex Hull.
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
Algorithm design techniques Dr. M. Gavrilova
Computational Geometry Capter:1-2.1
Graphs Chapter 11 Objectives Upon completion you will be able to:
Computational Geometry
Introduction to Algorithms
Convex Hull - most ubiquitous structure in computational geometry
Presentation transcript:

Week Aug-17 – Aug-22 Introduction to Spatial Computing CSE 5ISC Some slides adapted from Worboys and Duckham (2004) GIS: A Computing Perspective, Second Edition, CRC Press

Algorithms  An algorithm is a specification of a computational process required to perform some operation  For a given algorithm, we are usually interested in how efficient it is. Efficient algorithms require less computing resources when actually implemented  The efficiency of an algorithm is usually measured in terms of the time the algorithm uses, called time complexity or the amount of storage space required, called space complexity  For example, the time required to compute the breadth first search for any graph G = (V, E) is proportional to |V|, the number of input nodes  We use the “big-oh” notation to classify algorithms according to time complexity  O(n) stands for the set of algorithms that have a time complexity that is at most linearly proportional to n

Common Complexity Orders O(1)Constant timeVery fast O(log e n)Logarithmic timeFast O(n)O(n)Linear timeModerate O(n logn)Sub-linear timeModerate O(nk)O(nk)Polynomial timeSlow O(kn)O(kn)Exponential timeIntractable We all like these Not so much!

What about the complexity of these tasks? Can even have a correct and complete algorithm? Examples:  Geo-locate all human settlements e.g. tents (or usable roads) after an earthquake. You are given aerial images.  Given a digital satellite image, create an object based model for water bodies including wells (points), streams (line string) and lakes (polygons).  Given a news article (e.g. those from Google News), photograph, or video-clip, identify the geographic location it is describing.  Given postal addresses of hotels, determine the hotel closest to a specified point of interest (POI). Assume the availability of a geo-coding service to convert postal addresses to geographic point-locations

Special Considerations for Discrete Euclidean Plane

Geometric domains  Geometric domain is a triple, where:  G, the domain grid, is a finite connected portion of the discrete Euclidean plane, Z 2  P is a set of points in Z 2  S is a set of line segments in Z 2 Subject to the following closure conditions:  Each point of P is a point in the domain grid G  Any line segment in S must have its end-points as members of P  Any point in P that is incident with a line segment in S must be one of its end-points  If any two line segments in S intersect as a point, then that point must be a member of P

Grid Structures A structure that forms a geometric domain A structure that does not form a geometric domain

Discretization  Discretization : moving data from a continuous to a discrete domain (some precision will be lost) Can snap the intersection point to a nearest gird point? Point x in this example May not always work. Here the intersection point change its location with respect to line ef

Discretization – Drifting problem The chain axyzb has strayed well away from the original line segment ab Say we go ahead snapping the intersection point to the grid point x anyways

Green Yao Algorithm for Drifting problem  Imagine pegs put on the grid points.  Lines are imagined to be rubber strings  Lines can be stretched to include a point, but not cross a peg.

Green Yao Algorithm for Drifting problem

Discretizing Arcs

Spatial Algorithms for Raster data

Calculating Accumulated Water flow  Given the elevation filed of an geographic region.  Compute the water accumulated  Assume that water flows along the direction of steepest flow Rainfall FieldElevation Field Accumulated water Is this a local, focal or a zonal operation?

Intuition for Algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform a depth first search from each node.  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Intuition for algorithm  Construct a gradient descent graph.  Each node is connected to node with greatest descent.  Reverse the edges.  Perform depth first search from each node to get  Total water at a node = water from its descendants + self water Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Question  What should be the termination condition for the algorithm?  Does it need to keep track of any other information during the depth first search?  Hint: Think “what operation would get me to the equilibrium stage of accumulation?” Elevation Field A ABCD EFGH IJKL MNOP B CD EF GH IJ K L MN OP Reverse Gradient Descent Graph

Pseudo-Code (1/2) Input: Gradient descent graph with a set of N nodes and E edges. Each node is contains a value (rvalue) which denotes the amount of rainfall it received. Output: Modified gradient descent graph where each node contains the accumulated rain in its “rvalue” attribute.

Pseudo-Code (2/2) What is the time complexity of the algorithm?

Spatial Algorithms for Point Data

Convex Hull of N points in a plane Slides Adapted from Definition: Given set of N points in the Euclidean plane, convex hull is the minimum area convex region that contains every point. Intuition: points are nails perpendicular to plane, stretch an elastic rubber bound around all points; it will minimize length.  The input at 2N coordinates.  Size of the convex hull O(N) Sample Convex Hull

Convex Hull of N points in a plane Slides Adapted from Definition: Given set of N points in the Euclidean plane, convex hull is the minimum area convex region that contains every point. Intuition: points are nails perpendicular to plane, stretch an elastic rubber bound around all points; it will minimize length.  The output is returned as a sorted sequence of the points, clockwise (CW) along the boundary Sample Convex Hull

Intuitions used in the Algorithm  Property: The vertices of the convex hull are always points from the input.  Consequently, the edges of the convex hull connect two points of the input  Property: The supporting line of any convex hull edge has all input points to one side all points lie right of the directed line from p to q, if the edge from p to q is a convex hull edge

Intuitions used in the Algorithm  Property: The vertices of the convex hull are always points from the input.  Consequently, the edges of the convex hull connect two points of the input  Property: The supporting line of any convex hull edge has all input points to one side all points lie right of the directed line from p to q, if the edge from p to q is a convex hull edge

Simple Algorithm for Convex Hull

Incremental Algorithm for Convex Hull  Main idea: Sort the points from left to right (= by x-coordinate).  Insert the points in this order, and maintain the upper hull so far  First compute the upper boundary of the convex hull and then the lower part.

Incremental Algorithm for Convex Hull Observation: from left to right, there would be only right turns on the upper hull. Right Turn

Incremental Algorithm for Convex Hull Initialize by inserting the leftmost two points

Incremental Algorithm for Convex Hull If we add the third point there will be a right turn at the previous point, so we add it P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull If we add the fourth point we get a left turn at the third point P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull …..so we remove the third point from the upper hull when we add the fourth P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull If we add the fifth point we get a left turn at the fourth point P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull ….so we remove the fourth point when we add the fifth P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull If we add the sixth point we get a right turn at the fifth point, so we just add it P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull We also just add the seventh point as it was also a right turn. P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull When adding the eight point (a left turn) we must remove the seventh point P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull ….we must also remove the seventh point. It is also a left turn from current edge. P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull …. and also the sixth point. P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull …. and also the fifth point. P3 P4 P5 P6 P7 P8

Incremental Algorithm for Convex Hull After two more steps we get the result.

Pesudo-code for the Incremental algorithm