Intersection of Nonconvex Polygons Using the Alternate Hierarchical Decomposition, AHD by Rizwan Bulbul, and Andrew U. Frank Department of Geoinformation and Cartography Vienna University of Technology Vienna, Austria AGILE 2010 May 12, 2010
Representation of Geometry is still Difficult Observe not what we can do, but what application problems are not yet approached: 3D geometry Geometry with Movement
Regular Geometry needs Real Numbers Computers do REALs, which are approximations only: a/b * b <> a <> (a*b)/b Example problems: Test for point in polygon depends on order. Topology becomes not invariant under rotation!
Current solution (theoretically correct): Approximate coordinates with REALs Explicit representation of topology Avoid testing the same property twice, because it could produce inconsistencies. Theory of simplicial complex; base of ISO standard (OGC simple features)
Practice Subdivision in simplices produces too much data. Usually, the current 2D algorithm work ok using double precision REALs. No solution for 3D, 2D + time, 3D + time...
New Approach (after 20 years!): Approximation → big rationals Subdivisions in triangles → convex polytopes as base geometric element Big rationals: rationals (exactly homogenous coordinates) represented with big integers (i.e. integers which grow in size, limited only by size of memory)
Big Rationals Precise representation of straight line geometry. a/b * b = a (still not invariant under rotation) Contrary to (old) published reports, comparable speed to DOUBLE up to 100 digits length.
Convex polytopes Fundamental geometric operations on geometric figures: Intersection Union Intersection of convex polytope is convex! Union – Intersection are dual!
Representation of Convex Polytopes Represented as collection of points (in any dimension) Other representations (e.g. faces, edges) follow with convex hull algorithm (efficient, well known) Algorithm for n-D (using category theory and functional programming language)
Not all objects are convex! Geometries with holes, non-convex figures: Take convex hull. Too much: subtract convex hull of what is too much. Too little now: add convex hull of what has been subtracted too much...
Level of detail (LoD) Representation Representation can be used for a gradual (level of detail) rendering: Stop when enough detail is found.
INTRODUCTION Intersection computation – a fundamental operation Given two polygons (convex/nonconvex, with or without holes) compute the intersection region; Intersection Problem Intersection computation Intersection detection 12/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
AHD Alternate Hierarchical Decomposition Approach Recursive Convex hull tree, CHT Dimension Independence Convex hull computation Use any existing algorithm Delta region extraction Symmetric difference Split connected regions 13/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
AHD Alternate Hierarchical Decomposition- Example Hole Convex Hull Tree, CHT 14/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Assumptions Simple Intersection detection – not addressed May contain holes or nested holes “Left handed rule” for edge representations – counterclockwise orientation Demonstrated here for a pair of polygons- extendible for multiple polygons Flat objects 15/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Our Approach 16/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Convex 17/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Convex-convex : Algorithm 18/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Convex Nonconvex a1 b1 a1 b2 19/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Convex-nonconvex: Algorithm 20/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Nonconvex 21/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Generic Intersection - Algorithm 22/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Our Approach - Example r1 r2 23/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Our Approach - Example Result: set of disjoint regions 24/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Special Cases Complete overlapNo One is inside otherNo Edges overlapNo Points overlapNo Intersection is a lineYes Intersection is a pointYes 25/17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION Conclusion Based on basic intersection operation between two convex hulls Improvements and Future Work Multiple polygons Non simple polygons Other Boolean operations – Union, Symmetric difference, Point in a polygon City modelling 26/17 Dimension independent Ease of implementation – Haskell Numerical robustness Hierarchical tree data structure, CHT CHT allows reduced number of computations Deals most special cases Useful for applications where decomposed output is needed INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES
INTERSECTION References Chazelle, B. and D. P. Dobkin "Intersection of convex objects in two and three dimensions." Journal of the ACM (JACM) 34(1):1-27. David, M. Mount "Geometric intersection." In Handbook of discrete and computational geometry: CRC Press, Inc. Bulbul, Rizwan and Andrew U. Frank "AHD: The Alternate Hierarchical Decomposition of Nonconvex Polytopes (Generalization of a Convex Polytope Based Spatial Data Model)." In 17th International Conference on Geoinformatics. Fairfax, USA. Shamos, Michael Ian and Dan Hoey "Geometric intersection problems." In Proceedings of the 17th Annual Symposium on Foundations of Computer Science: IEEE Computer Society. O'Rourke, Joseph Computational Geometry in C (Cambridge Tracts in Theoretical Computer Science): Cambridge University Press. Jones, Simon Haskell 98 Language and Libraries: The Revised Report: {Cambridge University Press}. Bulbul, Rizwan, Farid Karimipour and Andrew Frank "A Simplex based Dimension Independent Approach for Convex Decomposition of Nonconvex polytopes." In 10th lnternational Conference on GeoComputation (GeoComputation 2009). UNSW, Sydney, Australia. Vatti, Bala R "A Generic Solution to Polygon Clipping." Communications of the ACM 35(7): /17 INTRODUCTION AHDASSUMPTIONS SPECIAL CASESOUR APPROACHCONCLUSION REFERENCES