org.deegree.geometry.refs
Class GeometryReference<T extends Geometry>

java.lang.Object
  extended by org.deegree.commons.tom.Reference<T>
      extended by org.deegree.commons.tom.gml.GMLReference<T>
          extended by org.deegree.geometry.refs.GeometryReference<T>
Type Parameters:
T -
All Implemented Interfaces:
GMLObject, Object, TypedObjectNode, Geometry
Direct Known Subclasses:
GeometricPrimitiveReference, SolidReference

public class GeometryReference<T extends Geometry>
extends GMLReference<T>
implements Geometry

Represents a reference to the GML representation of a geometry, which is usually expressed using an xlink:href attribute in GML (may be document-local or remote).

Version:
$Revision: 31649 $, $Date: 2011-08-25 01:03:49 +0200 (Thu, 25 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.deegree.geometry.Geometry
Geometry.GeometryType
 
Constructor Summary
GeometryReference(GMLReferenceResolver resolver, String uri, String baseURL)
          Creates a new GeometryReference instance.
 
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.
 GMLStdProps getGMLProperties()
          Returns the standard GML properties (e.g.
 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 standardProps)
          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 class org.deegree.commons.tom.Reference
getId, getReferencedObject, getURI, isLocal, isResolved, resolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.geometry.Geometry
getId
 

Constructor Detail

GeometryReference

public GeometryReference(GMLReferenceResolver resolver,
                         String uri,
                         String baseURL)
Creates a new GeometryReference instance.

Parameters:
resolver - used for resolving the reference, must not be null
uri - the geometry's uri, must not be null
baseURL - base URL for resolving the uri, may be null (no resolving of relative URLs)
Method Detail

contains

public boolean contains(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry contains the specified geometry. TODO formal explanation (DE9IM)

Specified by:
contains in interface Geometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry contains geometry

crosses

public boolean crosses(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry crosses the specified geometry. TODO formal explanation (DE9IM)

Specified by:
crosses in interface Geometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry crosses geometry

getDifference

public Geometry getDifference(Geometry geometry)
Description copied from interface: Geometry
Returns the set-theoretic difference of this and the passed Geometry.

Specified by:
getDifference in interface Geometry
Parameters:
geometry - other geometry, must not be null
Returns:
difference Geometry or null (empty set)

getDistance

public Measure getDistance(Geometry geometry,
                           Unit requestedUnits)
Description copied from interface: Geometry
Returns the minimum distance between this and the specified geometry.

Specified by:
getDistance in interface Geometry
Parameters:
geometry - second geometry
requestedUnits - unit of the
Returns:
shortest distance between the two geometries

equals

public boolean equals(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry is equal to the specified geometry. TODO formal explanation (DE9IM)

Specified by:
equals in interface Geometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry is equal to geometry

getBuffer

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

Specified by:
getBuffer in interface Geometry
Returns:
buffer geometry

getConvexHull

public Geometry getConvexHull()
Description copied from interface: Geometry
Returns the convex hull of the geometry.

Specified by:
getConvexHull in interface Geometry
Returns:
convex hull of a Geometry

getCoordinateDimension

public int getCoordinateDimension()
Description copied from interface: Geometry
Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.

Specified by:
getCoordinateDimension in interface Geometry
Returns:
the coordinate dimension

getCoordinateSystem

public ICRS getCoordinateSystem()
Description copied from interface: Geometry
Returns the associated spatial reference system.

Specified by:
getCoordinateSystem in interface Geometry
Returns:
spatial reference system, may be null

getEnvelope

public Envelope getEnvelope()
Description copied from interface: Geometry
Returns the minimal bounding box of the geometry.

Specified by:
getEnvelope in interface Geometry
Returns:
the minimal bounding box of the geometry

getGeometryType

public Geometry.GeometryType getGeometryType()
Description copied from interface: Geometry
Returns the type of geometry.

Specified by:
getGeometryType in interface Geometry
Returns:
the type of geometry

getPrecision

public PrecisionModel getPrecision()
Description copied from interface: Geometry
Returns the PrecisionModel of the geometry.

Specified by:
getPrecision in interface Geometry
Returns:
the precision model

getIntersection

public Geometry getIntersection(Geometry geometry)
Description copied from interface: Geometry
Returns the set-theoretic intersection of this and the passed Geometry.

Specified by:
getIntersection in interface Geometry
Parameters:
geometry - other geometry, must not be null
Returns:
intersection Geometry or null (empty set)

intersects

public boolean intersects(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry intersects the specified geometry. TODO formal explanation (DE9IM)

Specified by:
intersects in interface Geometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry intersects geometry

isDisjoint

public boolean isDisjoint(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry is disjoint from the specified geometry. TODO formal explanation (DE9IM)

Specified by:
isDisjoint in interface Geometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry is disjoint from geometry

overlaps

public boolean overlaps(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry overlaps the specified geometry. TODO formal explanation (DE9IM)

Specified by:
overlaps in interface Geometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry overlaps geometry

touches

public boolean touches(Geometry geometry)
Description copied from interface: Geometry
Tests whether this geometry touches the specified geometry. TODO formal explanation (DE9IM)

Specified by:
touches in interface Geometry
Parameters:
geometry - the Geometry to test this Geometry against
Returns:
true if this Geometry touches geometry

isBeyond

public boolean isBeyond(Geometry geometry,
                        Measure distance)
Description copied from interface: Geometry
Tests whether this geometry is beyond a specified distance of a second geometry.

Specified by:
isBeyond in interface Geometry
Parameters:
geometry - second geometry
Returns:
true, iff the minimum distance between this and the second geometry is greater than distance

isWithin

public boolean isWithin(Geometry geometry)
Description copied from interface: Geometry
tests whether the value of a geometric is topological located within this geometry. This method is the opposite of Geometry.contains(Geometry) method

Specified by:
isWithin in interface Geometry
Returns:
true if passed geometry is located completly within this geometry

isWithinDistance

public boolean isWithinDistance(Geometry geometry,
                                Measure distance)
Description copied from interface: Geometry
Tests whether this geometry is within a specified distance of a second geometry.

Specified by:
isWithinDistance in interface Geometry
Parameters:
geometry - second geometry
Returns:
true, iff the distance between this and the second geometry is less than or equal distance

getUnion

public Geometry getUnion(Geometry geometry)
Description copied from interface: Geometry
Returns the set-theoretic union of this and the passed Geometry.

Specified by:
getUnion in interface Geometry
Parameters:
geometry - other geometry, must not be null
Returns:
united Geometry (never null)

getGMLProperties

public GMLStdProps getGMLProperties()
Description copied from interface: GMLObject
Returns the standard GML properties (e.g. gml:name).

Specified by:
getGMLProperties in interface GMLObject
Overrides:
getGMLProperties in class GMLReference<T extends Geometry>
Returns:
the standard GML properties, may be

setGMLProperties

public void setGMLProperties(GMLStdProps standardProps)
Description copied from interface: Geometry
Sets the attached properties (e.g. GML standard properties, such as gml:name).

Specified by:
setGMLProperties in interface Geometry
Parameters:
standardProps - properties to be attached

getCentroid

public Point getCentroid()
Description copied from interface: Geometry
Returns the centroid of the geometry.

Specified by:
getCentroid in interface Geometry
Returns:
a Point that is the centroid of this geometry

setCoordinateSystem

public void setCoordinateSystem(ICRS crs)
Description copied from interface: Geometry
Sets the associated spatial reference system.

Specified by:
setCoordinateSystem in interface Geometry
Parameters:
crs - spatial reference system, may be null

setId

public void setId(String id)
Description copied from interface: Geometry
Sets the id of the geometry.

Specified by:
setId in interface Geometry
Parameters:
id - id of the geometry

setPrecision

public void setPrecision(PrecisionModel pm)
Description copied from interface: Geometry
Sets the PrecisionModel of the geometry.

Specified by:
setPrecision in interface Geometry
Parameters:
pm - the precision model to set

isSFSCompliant

public boolean isSFSCompliant()
Description copied from interface: Geometry
Returns whether this geometry complies with the Simple Feature Specification (SFS).

Specified by:
isSFSCompliant in interface Geometry
Returns:
true, if this geometry complies with the SFS, false otherwise


Copyright © 2011. All Rights Reserved.