deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.spatialschema
Interface Geometry

All Superinterfaces:
Serializable
All Known Subinterfaces:
Aggregate, Boundary, Complex, ComplexBoundary, Composite, CompositeCurve, CompositePoint, CompositeSolid, CompositeSurface, Curve, CurveBoundary, MultiCurve, MultiGeometry, MultiPoint, MultiPrimitive, MultiSolid, MultiSurface, OrientableCurve, OrientablePrimitive, OrientableSurface, Point, Primitive, PrimitiveBoundary, Ring, Shell, Solid, SolidBoundary, Surface, SurfaceBoundary
All Known Implementing Classes:
AggregateImpl, BoundaryImpl, CurveBoundaryImpl, CurveImpl, GeometryImpl, MultiCurveImpl, MultiGeometryImpl, MultiPointImpl, MultiPrimitiveImpl, MultiSurfaceImpl, OrientableCurveImpl, OrientablePrimitiveImpl, OrientableSurfaceImpl, PointImpl, PrimitiveBoundaryImpl, PrimitiveImpl, RingImpl, SurfaceBoundaryImpl, SurfaceImpl

public interface Geometry
extends Serializable

The basic interface for all geometries. it declares the methods that are common to all geometries. this doesn't means for example that all geometries defines a valid boundary but is there asked for they should be able to answer (with null).

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Field Summary
static int BUFFER_CAP_BUTT
          a straight line perpendicular to the end segment
static int BUFFER_CAP_ROUND
          (default) a semi-circle
static int BUFFER_CAP_SQUARE
          a half-square
 
Method Summary
 boolean contains(Geometry other)
          The Boolean valued operation "contains" shall return TRUE if this Geometry contains another Geometry.
 boolean contains(Position position)
          The Boolean valued operation "contains" shall return TRUE if this Geometry contains a single point given by a coordinate.
 Geometry difference(Geometry other)
          The "difference" operation shall return the set theoretic difference of this Geometry and the passed Geometry.
 double distance(Geometry other)
          The operation "distance" shall return the distance between this Geometry and another Geometry.
 Boundary getBoundary()
           
 Geometry getBuffer(double distance)
          The operation "buffer" shall return a Geometry containing all points whose distance from this Geometry is less than or equal to the "distance" passed as a parameter.
 Geometry getBuffer(double distance, int segments, int capStyle)
          The operation "buffer" shall return a Geometry containing all points whose distance from this Geometry is less than or equal to the "distance" passed as a parameter.
 Point getCentroid()
          The operation "centroid" shall return the mathematical centroid for this Geometry.
 Geometry getConvexHull()
          The operation "convexHull" shall return a Geometry that represents the convex hull of this Geometry.
 int getCoordinateDimension()
          The operation "coordinateDimension" shall return the dimension of the coordinates that define this Geometry, which must be the same as the coordinate dimension of the coordinate reference system for this Geometry.
 CoordinateSystem getCoordinateSystem()
           
 int getDimension()
          The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension.
 Envelope getEnvelope()
           
 double getTolerance()
           
 Geometry intersection(Geometry other)
          The "intersection" operation shall return the set theoretic intersection of this Geometry and the passed Geometry.
 boolean intersects(Geometry other)
          The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry.
 boolean isEmpty()
           
 boolean isWithinDistance(Geometry other, double distance)
          provide optimized proximity queries within for a distance . calvin added on 10/21/2003
 void setTolerance(double tolerance)
          sets tolerance value use for topological operations
 void translate(double[] d)
          translate a geometry by the submitted values. if the length of d is smaller then the dimension of the geometry only the first d.length'th coordinates will be translated.
 Geometry union(Geometry other)
          The "union" operation shall return the set theoretic union of this Geometry and the passed Geometry.
 

Field Detail

BUFFER_CAP_ROUND

static final int BUFFER_CAP_ROUND
(default) a semi-circle

See Also:
Constant Field Values

BUFFER_CAP_BUTT

static final int BUFFER_CAP_BUTT
a straight line perpendicular to the end segment

See Also:
Constant Field Values

BUFFER_CAP_SQUARE

static final int BUFFER_CAP_SQUARE
a half-square

See Also:
Constant Field Values
Method Detail

getEnvelope

Envelope getEnvelope()
Returns:
the bounding box of a geometry

getBoundary

Boundary getBoundary()
Returns:
the boundary of a geometry

getDimension

int getDimension()
The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension. The dimension of a collection of geometric objects shall be the largest dimension of any of its pieces. Points are 0-dimensional, curves are 1-dimensional, surfaces are 2-dimensional, and solids are 3-dimensional.

Returns:
the for this geometry defined dimension.

getCoordinateDimension

int getCoordinateDimension()
The operation "coordinateDimension" shall return the dimension of the coordinates that define this Geometry, which must be the same as the coordinate dimension of the coordinate reference system for this Geometry.

Returns:
the actual dimension

getCoordinateSystem

CoordinateSystem getCoordinateSystem()
Returns:
the spatial reference system of a geometry

isEmpty

boolean isEmpty()
Returns:
true if no geometry values resp. points stored within the geometry.

distance

double distance(Geometry other)
The operation "distance" shall return the distance between this Geometry and another Geometry. This distance is defined to be the greatest lower bound of the set of distances between all pairs of points that include one each from each of the two Geometries. A "distance" value shall be a positive number associated to distance units such as meters or standard foot. If necessary, the second geometric object shall be transformed into the same coordinate reference system as the first before the distance is calculated.

If the geometric objects overlap, or touch, then their distance apart shall be zero. Some current implementations use a "negative" distance for such cases, but the approach is neither consistent between implementations, nor theoretically viable.

Parameters:
other -
Returns:
the distance between this Geometry and another Geometry

translate

void translate(double[] d)
translate a geometry by the submitted values. if the length of d is smaller then the dimension of the geometry only the first d.length'th coordinates will be translated. If the length of d is larger then the dimension of the geometry an ArrayIndexOutOfBoundExceptions raises.

Parameters:
d - vector to translate the geometry with

getCentroid

Point getCentroid()
The operation "centroid" shall return the mathematical centroid for this Geometry. The result is not guaranteed to be on the object. For heterogeneous collections of primitives, the centroid only takes into account those of the largest dimension. For example, when calculating the centroid of surfaces, an average is taken weighted by area. Since curves have no area they do not contribute to the average.

Returns:
the centroid

getConvexHull

Geometry getConvexHull()
The operation "convexHull" shall return a Geometry that represents the convex hull of this Geometry.

Returns:
the convexHull

getBuffer

Geometry getBuffer(double distance)
The operation "buffer" shall return a Geometry containing all points whose distance from this Geometry is less than or equal to the "distance" passed as a parameter. The Geometry returned is in the same reference system as this original Geometry. The dimension of the returned Geometry is normally the same as the coordinate dimension - a collection of Surfaces in 2D space and a collection of Solids in 3D space, but this may be application defined.

Parameters:
distance -
Returns:
a Geometry containing all points whose distance from this Geometry is less than or equal to the "distance" passed as a parameter

getBuffer

Geometry getBuffer(double distance,
                   int segments,
                   int capStyle)
The operation "buffer" shall return a Geometry containing all points whose distance from this Geometry is less than or equal to the "distance" passed as a parameter. The Geometry returned is in the same reference system as this original Geometry. The dimension of the returned Geometry is normally the same as the coordinate dimension - a collection of Surfaces in 2D space and a collection of Solids in 3D space, but this may be application defined.

Parameters:
distance -
segments -
capStyle -
Returns:
a Geometry containing all points whose distance from this Geometry is less than or equal to the "distance" passed as a parameter

contains

boolean contains(Geometry other)
The Boolean valued operation "contains" shall return TRUE if this Geometry contains another Geometry.

Parameters:
other -
Returns:
true if the other is conatained.

contains

boolean contains(Position position)
The Boolean valued operation "contains" shall return TRUE if this Geometry contains a single point given by a coordinate.

Parameters:
position -
Returns:
true if this contains the position.

intersects

boolean intersects(Geometry other)
The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry. Within a Complex, the Primitives do not intersect one another. In general, topologically structured data uses shared geometric objects to capture intersection information.

Parameters:
other -
Returns:
true if this Geometry intersects another Geometry

union

Geometry union(Geometry other)
The "union" operation shall return the set theoretic union of this Geometry and the passed Geometry.

Parameters:
other -
Returns:
the union of this and the other.

intersection

Geometry intersection(Geometry other)
                      throws GeometryException
The "intersection" operation shall return the set theoretic intersection of this Geometry and the passed Geometry.

Parameters:
other -
Returns:
the intersection of this Geometry and the other Geometry.
Throws:
GeometryException

difference

Geometry difference(Geometry other)
The "difference" operation shall return the set theoretic difference of this Geometry and the passed Geometry.

Parameters:
other -
Returns:
the difference between this and the other.

isWithinDistance

boolean isWithinDistance(Geometry other,
                         double distance)
provide optimized proximity queries within for a distance . calvin added on 10/21/2003

Parameters:
other -
distance -
Returns:
true if the geometry is in distance of this geometry

setTolerance

void setTolerance(double tolerance)
sets tolerance value use for topological operations

Parameters:
tolerance -

getTolerance

double getTolerance()
Returns:
the tolerance value use for topological operations

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org