Top Banner
6. Simple Features Specification • Background information • UML overview • Simple features geometry
38

6. Simple Features Specification

Jan 16, 2016

Download

Documents

jersey

6. Simple Features Specification. Background information UML overview Simple features geometry. UML. The Unified Modeling Language (UML) is a standard way of representing software objects, as well as modeling non-software systems. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 6.  Simple Features Specification

6. Simple Features Specification

• Background information• UML overview• Simple features geometry

Page 2: 6.  Simple Features Specification

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

UML

A class in UML:

Page 4: 6.  Simple Features Specification

UML

Association between classes:

Page 5: 6.  Simple Features Specification

UML

Generalization (inheritance):

Page 6: 6.  Simple Features Specification

UML

Aggregation (composition):

Page 7: 6.  Simple Features Specification

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

UML

Note the differences between the triangle (inheritance) and diamond(aggregation) in the relationships between the classes.

Page 9: 6.  Simple Features Specification

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

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

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

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

LineString

Page 14: 6.  Simple Features Specification

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

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

Polygon

Page 17: 6.  Simple Features Specification

Polygon

Page 18: 6.  Simple Features Specification

Geometry

Polygon centroid:

Page 19: 6.  Simple Features Specification

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

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

MultiLineString A MultiLineString is a MultiCurve whose elements are LineStrings:

Page 22: 6.  Simple Features Specification

MultiPolygon

Page 23: 6.  Simple Features Specification

MultiPolygon

Page 24: 6.  Simple Features Specification

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

Geometry

The Envelope() for a Polygon:

Page 26: 6.  Simple Features Specification

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

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

Geometry

The Touches relationship:

Page 29: 6.  Simple Features Specification

Geometry

The Crosses relationship:

Page 30: 6.  Simple Features Specification

Geometry

The Within relationship:

Page 31: 6.  Simple Features Specification

Geometry

The Overlaps relationship:

Page 32: 6.  Simple Features Specification

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

Geometry

Buffer:

Page 34: 6.  Simple Features Specification

Geometry

Convex hull:

Page 35: 6.  Simple Features Specification

Geometry

Intersection:

Page 36: 6.  Simple Features Specification

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

Geometry

Page 38: 6.  Simple Features Specification

Geometry

Convex hull: