(Iso19107) of the Open Geospatial Consortium
Total Page:16
File Type:pdf, Size:1020Kb
Technical Report A Java Implementation of the OpenGIS™ Feature Geometry Abstract Specification (ISO 19107 Spatial Schema) Sanjay Dominik Jena, Jackson Roehrig {[email protected], [email protected]} University of Applied Sciences Cologne Institute for Technology in the Tropics Version 0.1 July 2007 ABSTRACT The Open Geospatial Consortium’s (OGC) Feature Geometry Abstract Specification (ISO/TC211 19107) describes a geometric and topological data structure for two and three dimensional representations of vector data. GeoAPI, an OGC working group, defines inter- face APIs derived from the ISO 19107. GeoTools provides an open source Java code library, which implements (OGC) specifications in close collaboration with GeoAPI projects. This work describes a partial but serviceable implementation of the ISO 19107 specifi- cation and its corresponding GeoAPI interfaces considering previous implementations and related specifications. It is intended to be a first impulse to the GeoTools project towards a full implementation of the Feature Geometry Abstract Specification. It focuses on aspects of spatial operations, such as robustness, precision, persistence and performance. A JUnit Test Suite was developed to verify the compliance of the implementation with the GeoAPI. The ISO 19107 is discussed and proposals for improvement of the GeoAPI are presented. II © Copyright by Sanjay Dominik Jena and Jackson Roehrig 2007 ACKNOWLEDGMENTS Our appreciation goes to the whole of the GeoTools and GeoAPI communities, in par- ticular to Martin Desruisseaux, Bryce Nordgren, Jody Garnett and Graham Davis for their extensive support and several discussions, and to the JTS developers, the JTS developer mail- ing list and to those, who will make use of and continue the implementation accomplished in this work. We also wish to acknowledge the support offered by Prof. Dr. Marco Antônio Casanova of the PUC-Rio, and would like to thank all the students and researchers of the TecGraf insti- tute for their support and assistance. IV Contents 1 Introduction 1 1.1 Standards and Specifications . 1 1.1.1 The Open Geospatial Consortium (OGC) . 1 1.1.2 ISO/TC211 . 3 1.1.3 GeoAPI and GeoTools . 4 1.2 Objectives of this work . 4 1.3 Document Structure . 5 2 Implementation Aspects 6 2.1 Dimension Model . 7 2.2 Robustness and Performance . 7 2.3 Precision and Robustness . 12 2.4 Data Storage and Persistence . 13 3 Geometry Data model 15 3.1 Geometry x Topology . 15 3.2 Geometry Root Object . 18 3.3 Primitives . 21 3.4 Complex . 25 3.5 Aggregates . 28 3.6 Coordinates . 29 4 Spatial analysis operators 32 4.1 Data Structure for the topological graph . 32 4.2 Geometric Predicates and Basic Algorithms . 33 4.3 Set Operations . 38 4.3.1 General Discussions . 39 4.3.2 Map Overlay . 43 4.4 Relational Boolean Operators . 50 V 4.4.1 The Intersection Matrix . 50 4.4.2 The Boolean Operators . 55 4.4.3 Algorithm . 60 4.5 Constructive Operations . 61 4.5.1 Buffer . 61 4.5.2 Centroid . 62 4.5.3 Convex Hull . 66 4.6 Metric Operations . 68 4.6.1 Distance . 68 5 Testing Suite 69 5.1 Test Environment . 69 5.2 Test Methodology . 70 6 Conclusions and Recommendations 72 6.1 Conclusions . 72 6.2 Future Work . 73 A Glossary 75 B Technical definitions 78 C Notations 80 D Observations and Recommendations 81 D.1 Abstract Specification Issues . 81 D.2 Recommendations for the GeoAPI . 82 D.2.1 Naming issues . 83 D.2.2 Interface and method modifications . 83 E Geometric objects and relations 87 E.1 Curve Types . 87 E.2 Polygon Types in the plane . 88 F Implementation Overview 94 F.1 Implemented Classes . 94 F.2 Implemented Methods . 94 Bibliography 97 VI List of Figures 1.1 Overview of the OGC Abstract Specifications (from [OGC05]) . 2 2.1 Geometry in the conceptual model . 6 2.2 The polyline seems locally straight, but not straight at all . 9 2.3 Exact geometric computation in map overlay [BH98] . 10 2.4 Metric operations are based on elementary operations, which use optionally floating point arithmetic or exact integer arithmetic . 13 3.1 Geometric objects can be represented in three different dimensions: 2D (a), 2.5D (b) [imgb] and 3D (c) . 15 3.2 Example of vector representation . 16 3.3 Neighbourhood relationships in topological representations . 17 3.4 Non-Manifolds: more then two faces connected to an edge . 18 3.5 Object Hierarchy of the Feature Geometry . 19 3.6 Curves: simple (a), simple closed (b), non-simple (c), non-simple closed (d), self-tangent (e) . 20 3.7 Polygons: simple convex (a), simple concave (b), simple with hole (c), complex (non-simple) (d) . 20 3.8 Surface orientation (a), no surface created (b), surface spliting (c) . 22 3.9 Curves segments building curves, curves composing a composite curve . 23 3.10 Spline and Bezier Curves . 24 3.11 Composite surface generated by two surfaces . 26 3.12 Composite solid generated by two solids (cubes) . 27 3.13 Examples of Complexes: CompositeCurves and CompositeSurfaces . 27 3.14 Geometric objects do or do not contain their boundaries . 28 3.15 Geometry Collections: MultiPoint (a), MultiLine (b), MultiPolygon (c) and Ag- gregate(d) . 29 3.16 Examples of envelopes . 30 VII 4.1 The Doubly-Connected Edge List . 33 4.2 Vector and point translation to the origin of the coordinate system for the ori- entation test of a point and a line segment . 34 4.3 Ring orientation test: if the the highest point, its predecessor and its successor are ccw oriented, the whole ring is ccw oriented (a); in case of collinearity the x value order of its predecessor abd successor decides (b) . 35 4.4 The Point-In-Polygon Test determines the number of intersections of rings with the semi-finite straight line starting from the given point: P1 and P4 lie outside the polygon and have an even number of intersections. P2 and P3 lie within the polygon and have an odd number of intersections, P5 and P6 are special cases colinear and tangent intersection lines . 37 4.5 Example of a Map Overlay: Three thematic maps with country, city and river information are overlaid into one map [imga] . 39 4.6 Set operations between two surfaces . 40 4.7 Different types of noding: The union of two curves (1) can be noded partially in topologically equivalent representations (2) or completely (3) . 41 4.8 Theoretically, set operations like difference can produce non-closed sets . 41 4.9 Merging ambiguousness: The lines in (a) and (b) are topologically equivalent, but are defined by a different sequence of control points. The union of the curves in (c) is shown in (d). The object type of its final representation is am- biguous. 42 4.10 The difference between two CompositeSurfaces can result in objects, which are not representable in conformance to the Abstract Specification . 43 4.11 The sweep line moves down to the next event point: As the event point is an intersection point, the involved segments sk and sl must be tested against their new neighbours . 45 4.12 A noded graph with directed edges . 46 4.13 Finding all intersections in the overlay operation using the plane sweep algorithm 48 4.14 Internal graph representation . 49 4.15 The 4-Intersection matrix: its different configurations describe eight topological relations between two regions (From [ECF94]) . 51 4.16 Interior, Boundary and Exterior of two Polygons: Polygon A contains Polygon B 52 4.17 The 9-Intersection matrix: regions with holes can be separated exactly into the eight specified topological relations by additional distinction of the polygon exterior (from [EH91]). 53 4.18 Disjoint geometric objects . 56 VIII 4.19 Examples of Touches relationships: Surface/Surface(a), Surface/Line (b), Sur- face/Point (c), Curve/Curve(d), Curve/Point(e) . 57 4.20 Examples of the Within / Contains relationship: Surface/Surface (a), Sur- face/Curve (b), Surface/Point (c), Curve/Curve(d) and Curve/Point (e) . 58 4.21 Examples of the overlaps relationship . 58 4.22 Examples of the crosses relationship . 59 4.23 Examples of buffers: a positive buffer can be performed on a curve (c2) and surface (s2), a negative buffer only on a surface (s3) . 62 4.24 Examples of centroids of geometric objects: a point set (a), a straight line (b), a curve (c), a simple polygon (d) and a simple polygon with a hole (e) . 63 4.25 Centroid of a triangle (a) and centroid of a surface computed by the centroids of the surface triangulation . ..