Title: 6' Simple Features Specification
16. Simple Features Specification
- Background information
- UML overview
- Simple features geometry
2UML
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 doesnt include all
of its features.
3UML
A class in UML
4UML
Association between classes
5UML
Generalization (inheritance)
6UML
Aggregation (composition)
7Simple 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.
8UML
Note the differences between the triangle
(inheritance) and diamond (aggregation) in the
relationships between the classes.
9Geometry
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.
10Point
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.
11Curve 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.
12LineString
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
13LineString
14Polygon
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.
15Polygon
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.
16Polygon
17Polygon
18Geometry
Polygon centroid
19GeometryCollection
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.
20MultiPoint
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.
21MultiLineString
A MultiLineString is a MultiCurve whose elements
are LineStrings
22MultiPolygon
23MultiPolygon
24Geometry
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.
25Geometry
The Envelope() for a Polygon
26Geometry
Text representations returned by AsText (useful
for reading/writing geometry from file or
database). A binary representation is also
specified
27Geometry
Boolean methods that describe spatial
relationships Equals(anotherGeometryGeometry)I
nteger Returns 1 (TRUE) if this geometric
object is spatially equal to anotherGeometry. T
ouches(anotherGeometryGeometry)Integer
Returns 1 (TRUE) if this geometric object
spatially touches anotherGeometry. Crosses(anot
herGeometryGeometry)Integer Returns 1 (TRUE)
if this geometric object spatially crosses
anotherGeometry. Within(anotherGeometryGeometry)
Integer Returns 1 (TRUE) if this geometric
object is spatially within anotherGeometry. Ove
rlaps(anotherGeometryGeometry)Integer Returns
1 (TRUE) if this geometric object spatially
overlaps anotherGeometry. Contains(anotherGeomet
ryGeometry)Integer Returns 1 (TRUE) if this
geometric object spatially contains
anotherGeometry.
28Geometry
The Touches relationship
29Geometry
The Crosses relationship
30Geometry
The Within relationship
31Geometry
The Overlaps relationship
32Geometry
Examples of additional methods that return
geometrical objects Buffer(distanceDouble)Geo
metry 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(anotherGeo
metryGeometry)Geometry Returns a geometric
object that represents the Point set intersection
of this geometric object with anotherGeometry. Un
ion(anotherGeometryGeometry)Geometry Returns
a geometric object that represents the Point set
union of this geometric object with
anotherGeometry. Difference(anotherGeometryGeome
try)Geometry Returns a geometric object that
represents the Point set difference of this
geometric object with anotherGeometry
33Geometry
Buffer
34Geometry
Convex hull
35Geometry
Intersection
36Geotools.net
The next two slides show the Geotools.net
geometry hierarchy, which implements Simple
Features geometry in C.
37Geometry
38Geometry
Convex hull