org.deegree.geometry
Interface Geometry

All Superinterfaces:
GMLObject, Object, TypedObjectNode
All Known Subinterfaces:
CompositeCurve, CompositeGeometry<T>, CompositeSolid, CompositeSurface, Curve, Envelope, GeometricPrimitive, LinearRing, LineString, MultiCurve<T>, MultiGeometry<T>, MultiLineString, MultiPoint, MultiPolygon, MultiSolid, MultiSurface<T>, OrientableCurve, OrientableSurface, Point, Polygon, PolyhedralSurface, Ring, Solid, Surface, Tin, TriangulatedSurface
All Known Implementing Classes:
AbstractDefaultGeometry, CurveReference, DefaultCompositeCurve, DefaultCompositeGeometry, DefaultCompositeSolid, DefaultCompositeSurface, DefaultCurve, DefaultEnvelope, DefaultLinearRing, DefaultLineString, DefaultMultiCurve, DefaultMultiGeometry, DefaultMultiLineString, DefaultMultiPoint, DefaultMultiPolygon, DefaultMultiSolid, DefaultMultiSurface, DefaultOrientableCurve, DefaultOrientableSurface, DefaultPoint, DefaultPolygon, DefaultPolyhedralSurface, DefaultRing, DefaultSolid, DefaultSurface, DefaultTin, DefaultTriangulatedSurface, GeometricPrimitiveReference, GeometryReference, LineStringReference, PointReference, PolygonReference, SolidReference, SurfaceReference

public interface Geometry
extends GMLObject

Base interface for all vector geometry types.

Root of deegree's ISO 19107/GML 3.1.1/GML 3.2.1 compliant geometry type hierarchy. All geometries inherit methods for the common topological predicates (e.g. intersects(Geometry) and touches(Geometry) as well as the usual geometry creation methods (e.g getIntersection(Geometry) and getBuffer(Measure)).

Topological predicates

These are the methods for evaluating the common topological predicates:

Set-theoretic methods

Methods for deriving geometries that aid spatial analysis tasks: Distance calculation:

Simple Feature Specification (SFS) compliance

TODO: check with specification
As the expressiveness of the ISO 19107 model is much more powerful than the Simple Feature Specification (SFS), a deegree Geometry is not automatically a compliant SFS geometry. isSFSCompliant() can be used to check if this is the case, it returns true for the following subtypes / configurations: If the geometry is not SFS-compliant, SFSProfiler can be used to simplify it into an SFS geometry.

Representation of GML geometries

The "StandardObjectProperties" defined by GML (e.g. multiple gml:name elements or gml:description) which are inherited by any GML geometry type definition are treated in a specific way. They are modelled using the GMLStdProps class. This design decision has been driven by the goal to make the implementation less GML (and GML-version) specific and to allow for example to export a Geometry instance as either GML 2, GML 3.1 or GML 3.2 (different namespaces and types for the standard properties).

Author:
Markus Schneider, Andreas Poth, last edited by: $Author: mschneider $

Nested Class Summary
static class Geometry.GeometryType
          Convenience enum type for discriminating the different geometry variants.
 
Method Summary
 boolean contains(Geometry geometry)
          Tests whether this geometry contains the specified geometry.
 boolean crosses(Geometry geometry)
          Tests whether this geometry crosses the specified geometry.
 boolean equals(Geometry geometry)
          Tests whether this geometry is equal to the specified geometry.
 Geometry getBuffer(Measure distance)
          Return a new Geometry that contains all points with a distance from this Geometry that is less than or equal to the specified distance.
 Point getCentroid()
          Returns the centroid of the geometry.
 Geometry getConvexHull()
          Returns the convex hull of the geometry.
 int getCoordinateDimension()
          Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.
 ICRS getCoordinateSystem()
          Returns the associated spatial reference system.
 Geometry getDifference(Geometry geometry)
          Returns the set-theoretic difference of this and the passed Geometry.
 Measure getDistance(Geometry geometry, Unit requestedUnits)
          Returns the minimum distance between this and the specified geometry.
 Envelope getEnvelope()
          Returns the minimal bounding box of the geometry.
 Geometry.GeometryType getGeometryType()
          Returns the type of geometry.
 String getId()
          Returns the id of the geometry.
 Geometry getIntersection(Geometry geometry)
          Returns the set-theoretic intersection of this and the passed Geometry.
 PrecisionModel getPrecision()
          Returns the PrecisionModel of the geometry.
 Geometry getUnion(Geometry geometry)
          Returns the set-theoretic union of this and the passed Geometry.
 boolean intersects(Geometry geometry)
          Tests whether this geometry intersects the specified geometry.
 boolean isBeyond(Geometry geometry, Measure distance)
          Tests whether this geometry is beyond a specified distance of a second geometry.
 boolean isDisjoint(Geometry geometry)
          Tests whether this geometry is disjoint from the specified geometry.
 boolean isSFSCompliant()
          Returns whether this geometry complies with the Simple Feature Specification (SFS).
 boolean isWithin(Geometry geometry)
          tests whether the value of a geometric is topological located within this geometry.
 boolean isWithinDistance(Geometry geometry, Measure distance)
          Tests whether this geometry is within a specified distance of a second geometry.
 boolean overlaps(Geometry geometry)
          Tests whether this geometry overlaps the specified geometry.
 void setCoordinateSystem(ICRS crs)
          Sets the associated spatial reference system.
 void setGMLProperties(GMLStdProps props)
          Sets the attached properties (e.g.
 void setId(String id)
          Sets the id of the geometry.
 void setPrecision(PrecisionModel pm)
          Sets the PrecisionModel of the geometry.
 boolean touches(Geometry geometry)
          Tests whether this geometry touches the specified geometry.
 
Methods inherited from interface org.deegree.commons.tom.gml.GMLObject
getGMLProperties
 

Method Detail

getGeometryType

Geometry.GeometryType getGeometryType()
Returns the type of geometry.

Returns:
the type of geometry

getId

String getId()
Returns the id of the geometry.

In a GML representation of the geometry, this corresponds to the gml:id (GML 3 and later) or gid (GML 2) attribute of the geometry element.

Specified by:
getId in interface Object
Returns:
the id of the geometry, or null if it is an anonymous (unidentified) geometry

setId

void setId(String id)
Sets the id of the geometry.

Parameters:
id - id of the geometry

getPrecision

PrecisionModel getPrecision()
Returns the PrecisionModel of the geometry.

Returns:
the precision model

setPrecision

void setPrecision(PrecisionModel pm)
Sets the PrecisionModel of the geometry.

Parameters:
pm - the precision model to set

getCoordinateSystem

ICRS getCoordinateSystem()
Returns the associated spatial reference system.

Returns:
spatial reference system, may be null

setCoordinateSystem

void setCoordinateSystem(ICRS crs)
Sets the associated spatial reference system.

Parameters:
crs - spatial reference system, may be null

setGMLProperties

void setGMLProperties(GMLStdProps props)
Sets the attached properties (e.g. GML standard properties, such as gml:name).

Parameters:
props - properties to be attached

isSFSCompliant

boolean isSFSCompliant()
Returns whether this geometry complies with the Simple Feature Specification (SFS).

Returns:
true, if this geometry complies with the SFS, false otherwise

getCoordinateDimension

int getCoordinateDimension()
Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.

Returns:
the coordinate dimension

contains

boolean contains(Geometry geometry)
Tests whether this geometry contains the specified geometry. TODO formal explanation (DE9IM)

Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry contains geometry

crosses

boolean crosses(Geometry geometry)
Tests whether this geometry crosses the specified geometry. TODO formal explanation (DE9IM)

Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry crosses geometry

equals

boolean equals(Geometry geometry)
Tests whether this geometry is equal to the specified geometry. TODO formal explanation (DE9IM)

Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry is equal to geometry

intersects

boolean intersects(Geometry geometry)
Tests whether this geometry intersects the specified geometry. TODO formal explanation (DE9IM)

Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry intersects geometry

isBeyond

boolean isBeyond(Geometry geometry,
                 Measure distance)
Tests whether this geometry is beyond a specified distance of a second geometry.

Parameters:
geometry - second geometry
distance -
Returns:
true, iff the minimum distance between this and the second geometry is greater than distance

isDisjoint

boolean isDisjoint(Geometry geometry)
Tests whether this geometry is disjoint from the specified geometry. TODO formal explanation (DE9IM)

Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry is disjoint from geometry

isWithin

boolean isWithin(Geometry geometry)
tests whether the value of a geometric is topological located within this geometry. This method is the opposite of contains(Geometry) method

Parameters:
geometry -
Returns:
true if passed geometry is located completly within this geometry

isWithinDistance

boolean isWithinDistance(Geometry geometry,
                         Measure distance)
Tests whether this geometry is within a specified distance of a second geometry.

Parameters:
geometry - second geometry
distance -
Returns:
true, iff the distance between this and the second geometry is less than or equal distance

overlaps

boolean overlaps(Geometry geometry)
Tests whether this geometry overlaps the specified geometry. TODO formal explanation (DE9IM)

Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry overlaps geometry

touches

boolean touches(Geometry geometry)
Tests whether this geometry touches the specified geometry. TODO formal explanation (DE9IM)

Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry touches geometry

getBuffer

Geometry getBuffer(Measure distance)
Return a new Geometry that contains all points with a distance from this Geometry that is less than or equal to the specified distance.

Parameters:
distance -
Returns:
buffer geometry

getCentroid

Point getCentroid()
Returns the centroid of the geometry.

Returns:
a Point that is the centroid of this geometry

getEnvelope

Envelope getEnvelope()
Returns the minimal bounding box of the geometry.

Returns:
the minimal bounding box of the geometry

getDifference

Geometry getDifference(Geometry geometry)
Returns the set-theoretic difference of this and the passed Geometry.

Parameters:
geometry - other geometry, must not be null
Returns:
difference Geometry or null (empty set)

getIntersection

Geometry getIntersection(Geometry geometry)
Returns the set-theoretic intersection of this and the passed Geometry.

Parameters:
geometry - other geometry, must not be null
Returns:
intersection Geometry or null (empty set)

getUnion

Geometry getUnion(Geometry geometry)
Returns the set-theoretic union of this and the passed Geometry.

Parameters:
geometry - other geometry, must not be null
Returns:
united Geometry (never null)

getConvexHull

Geometry getConvexHull()
Returns the convex hull of the geometry.

Returns:
convex hull of a Geometry

getDistance

Measure getDistance(Geometry geometry,
                    Unit requestedUnits)
Returns the minimum distance between this and the specified geometry.

Parameters:
geometry - second geometry
requestedUnits - unit of the
Returns:
shortest distance between the two geometries


Copyright © 2011. All Rights Reserved.