6. Simple Features Specification
description
Transcript of 6. Simple Features Specification
![Page 1: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/1.jpg)
6. Simple Features Specification
• Background information• UML overview• Simple features geometry
![Page 2: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/2.jpg)
UML
The Unified Modeling Language (UML) is a standard way of representing software objects, as well as modeling non-software systems.
It is commonly used in describing object-oriented code libraries, such as the Simple Features Specification.
It grew out of object-oriented software modeling by private companies in the early-mid ‘90s, and was established as an industry-wide standard in the late ’90s.
Visual Studio includes a two-way code visualization tool that is similar to UML, but doesn’t include all of its features.
![Page 3: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/3.jpg)
UML
A class in UML:
![Page 4: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/4.jpg)
UML
Association between classes:
![Page 5: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/5.jpg)
UML
Generalization (inheritance):
![Page 6: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/6.jpg)
UML
Aggregation (composition):
![Page 7: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/7.jpg)
Simple Features Specification
With that quick introduction, we can now look at the Simple Features Specification, which uses UML to diagram its components.
SFS is a simplified geometry model, independent of any particular implementation, that describes a way of representing geometry that can be used in a GIS.
SFS is a part of a series of standards published by the Open Geospatial Consortium, details of which are available at www.opengeospatial.org.
There are multiple implementations, including
Geotools.net, which we will use in class labs.
![Page 8: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/8.jpg)
UML
Note the differences between the triangle (inheritance) and diamond(aggregation) in the relationships between the classes.
![Page 9: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/9.jpg)
Geometry
Geometry is the root class of the hierarchy. Geometry is an abstract (non-instantiable) class.
It contains methods available in all geometry objects
These include descriptive methods, methods used to compare different geometries.
These will be reviewed after describing the kinds of available geometries.
![Page 10: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/10.jpg)
Point
A Point is a 0-dimensional geometric object and represents a single location in coordinate space.
A Point has an x-coordinate value and a y-coordinate value (doubles).
The boundary of a Point is the empty set.
![Page 11: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/11.jpg)
Curve and LineString
A Curve is a one-dimensional geometric object usually stored as a sequence of points, with the subtype of Curve specifying the form of the interpolation between points.
The Simple Features Spec defines only one subclass of Curve, LineString, which uses linear interpolation between points.
![Page 12: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/12.jpg)
LineString
A LineString is a Curve with linear interpolation between points. Each consecutive pair of points defines a line segment.
A Line is a LineString with exactly 2 points.
A LinearRing is a LineString that is both closed and simple.
LinearRings are the basis of Polygons
![Page 13: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/13.jpg)
LineString
![Page 14: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/14.jpg)
Polygon
A Polygon inherits from Surface and contains LinearRings.
As in LineString and Curve, Polygon is the only Surface in the Simple Features Spec.
Each interior boundary defines a hole in the Polygon.
![Page 15: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/15.jpg)
Polygon A Polygon is a planar Surface, defined by 1 exterior boundary
and 0 or more interior boundaries. Each interior boundary defines a hole in the Polygon.
Polygons are topologically closed.
The boundary of a Polygon consists of a set of LinearRings that make up its exterior and interior boundaries.
No two rings in the boundary cross, the rings in the boundary of a Polygon may intersect at a Point but only as a tangent
A Polygon may not have cut lines, spikes or punctures.
Useful methods include Centroid, Area, and PointOnSurface.
![Page 16: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/16.jpg)
Polygon
![Page 17: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/17.jpg)
Polygon
![Page 18: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/18.jpg)
Geometry
Polygon centroid:
![Page 19: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/19.jpg)
GeometryCollection
A GeometryCollection is a collection of 1 or more geometric objects.
It inherits from Geometry, and implements abstract methods defined in the Geometry class.
Collections are defined for each type of Geometry.
![Page 20: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/20.jpg)
MultiPoint
The elements of a MultiPoint are restricted to Points.
The Points are not connected or ordered.
A MultiPoint is simple if no two Points in the MultiPoint are equal (have identical coordinate values).
The boundary of a MultiPoint is the empty set.
![Page 21: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/21.jpg)
MultiLineString A MultiLineString is a MultiCurve whose elements are LineStrings:
![Page 22: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/22.jpg)
MultiPolygon
![Page 23: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/23.jpg)
MultiPolygon
![Page 24: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/24.jpg)
Geometry
Now that we have described the kinds of geometries available, we can cover some of the methods in the Geometry class that apply to all of them.
Descriptive methods:
Envelope( ):Geometry — The minimum bounding box for this Geometry, returned as a Geometry. The polygon is defined by the corner points of the bounding box [(MINX, MINY), (MAXX, MINY), (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)].
IsEmpty( ):Integer — Returns 1 (TRUE) if this geometric object is the empty geometry. If true, then this geometric object represents the empty point set, , for the ∅coordinate space.
AsText( ):String — Exports this geometric object to a specific Well-known Text Representation of Geometry.
IsSimple( ):Integer —Returns 1 (TRUE) if this Geometry has no anomalous geometric points, such as self intersection or self tangency.
![Page 25: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/25.jpg)
Geometry
The Envelope() for a Polygon:
![Page 26: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/26.jpg)
Geometry
Text representations returned by AsText (useful for reading/writing geometry from file or database). A binary representation is also specified:
![Page 27: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/27.jpg)
Geometry
Boolean methods that describe spatial relationships:
Equals(anotherGeometry:Geometry):Integer — Returns 1 (TRUE) if this geometric object is “spatially equal” to anotherGeometry.
Touches(anotherGeometry:Geometry):Integer — Returns 1 (TRUE) if this geometric object “spatially touches” anotherGeometry.
Crosses(anotherGeometry:Geometry):Integer — Returns 1 (TRUE) if this geometric object “spatially crosses’ anotherGeometry.
Within(anotherGeometry:Geometry):Integer — Returns 1 (TRUE) if this geometric object is “spatially within” anotherGeometry.
Overlaps(anotherGeometry:Geometry):Integer — Returns 1 (TRUE) if this geometric object “spatially overlaps” anotherGeometry.
Contains(anotherGeometry:Geometry):Integer — Returns 1 (TRUE) if this geometric object “spatially contains” anotherGeometry.
![Page 28: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/28.jpg)
Geometry
The Touches relationship:
![Page 29: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/29.jpg)
Geometry
The Crosses relationship:
![Page 30: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/30.jpg)
Geometry
The Within relationship:
![Page 31: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/31.jpg)
Geometry
The Overlaps relationship:
![Page 32: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/32.jpg)
Geometry
Examples of additional methods that return geometrical objects:
Buffer(distance:Double):Geometry — Returns a geometric object that represents all Points whose distance from this geometric object is less than or equal to distance.
ConvexHull( ):Geometry — Returns a geometric object that represents the convex hull of this geometric object.
Intersection(anotherGeometry:Geometry):Geometry — Returns a geometric object that represents the Point set intersection of this geometric object with anotherGeometry.
Union(anotherGeometry:Geometry):Geometry — Returns a geometric object that represents the Point set union of this geometric object with anotherGeometry.
Difference(anotherGeometry:Geometry):Geometry — Returns a geometric object that represents the Point set difference of this geometric object with anotherGeometry
![Page 33: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/33.jpg)
Geometry
Buffer:
![Page 34: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/34.jpg)
Geometry
Convex hull:
![Page 35: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/35.jpg)
Geometry
Intersection:
![Page 36: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/36.jpg)
Geotools.net
The next two slides show the Geotools.net geometry hierarchy, which implements
Simple Features geometry in C#.
![Page 37: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/37.jpg)
Geometry
![Page 38: 6. Simple Features Specification](https://reader034.fdocuments.in/reader034/viewer/2022050819/56814b85550346895db86b79/html5/thumbnails/38.jpg)
Geometry
Convex hull: