org.deegree.model.geometry
Interface GM_Object

All Known Subinterfaces:
GM_Aggregate, GM_Boundary, GM_Complex, GM_ComplexBoundary, GM_Composite, GM_CompositeCurve, GM_CompositePoint, GM_CompositeSolid, GM_CompositeSurface, GM_Curve, GM_CurveBoundary, GM_MultiCurve, GM_MultiPoint, GM_MultiPrimitive, GM_MultiSolid, GM_MultiSurface, GM_OrientableCurve, GM_OrientablePrimitive, GM_OrientableSurface, GM_Point, GM_Primitive, GM_PrimitiveBoundary, GM_Ring, GM_Shell, GM_Solid, GM_SolidBoundary, GM_Surface, GM_SurfaceBoundary
All Known Implementing Classes:
GM_Aggregate_Impl, GM_Boundary_Impl, GM_Curve_Impl, GM_CurveBoundary_Impl, GM_MultiCurve_Impl, GM_MultiPoint_Impl, GM_MultiPrimitive_Impl, GM_MultiSurface_Impl, GM_Object_Impl, GM_OrientableCurve_Impl, GM_OrientablePrimitive_Impl, GM_OrientableSurface_Impl, GM_Point_Impl, GM_Primitive_Impl, GM_PrimitiveBoundary_Impl, GM_Ring_Impl, GM_Surface_Impl, GM_SurfaceBoundary_Impl

public interface GM_Object

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: 1.4 $ $Date: 2003/10/23 13:24:14 $

Author:
Andreas Poth

Method Summary
 boolean contains(GM_Object gmo)
          The Boolean valued operation "contains" shall return TRUE if this GM_Object contains another GM_Object.
 boolean contains(GM_Position position)
          The Boolean valued operation "contains" shall return TRUE if this GM_Object contains a single point given by a coordinate.
 GM_Object difference(GM_Object gmo)
          The "difference" operation shall return the set theoretic difference of this GM_Object and the passed GM_Object.
 double distance(GM_Object gmo)
          The operation "distance" shall return the distance between this GM_Object and another GM_Object.
 GM_Boundary getBoundary()
          returns the boundary of a geometry
 GM_Object getBuffer(double distance)
          The operation "buffer" shall return a GM_Object containing all points whose distance from this GM_Object is less than or equal to the "distance" passed as a parameter.
 GM_Point getCentroid()
          The operation "centroid" shall return the mathematical centroid for this GM_Object.
 GM_Object getConvexHull()
          The operation "convexHull" shall return a GM_Object that represents the convex hull of this GM_Object.
 int getCoordinateDimension()
          The operation "coordinateDimension" shall return the dimension of the coordinates that define this GM_Object, which must be the same as the coordinate dimension of the coordinate reference system for this GM_Object.
 CS_CoordinateSystem getCoordinateSystem()
          returns the spatial reference system of a geometry
 int getDimension()
          The operation "dimension" shall return the inherent dimension of this GM_Object, which shall be less than or equal to the coordinate dimension.
 GM_Envelope getEnvelope()
          returns the bounding box of a geometry
 GM_Object intersection(GM_Object gmo)
          The "intersection" operation shall return the set theoretic intersection of this GM_Object and the passed GM_Object.
 boolean intersects(GM_Object gmo)
          The Boolean valued operation "intersects" shall return TRUE if this GM_Object intersects another GM_Object.
 boolean isEmpty()
          returns true if no geometry values resp. points stored within the geometry.
 boolean isWithinDistance(GM_Object gmo, double distance)
           
 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.
 GM_Object union(GM_Object gmo)
          The "union" operation shall return the set theoretic union of this GM_Object and the passed GM_Object.
 

Method Detail

getEnvelope

public GM_Envelope getEnvelope()
returns the bounding box of a geometry


getBoundary

public GM_Boundary getBoundary()
returns the boundary of a geometry


getDimension

public int getDimension()
The operation "dimension" shall return the inherent dimension of this GM_Object, 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.


getCoordinateDimension

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


getCoordinateSystem

public CS_CoordinateSystem getCoordinateSystem()
returns the spatial reference system of a geometry


isEmpty

public boolean isEmpty()
returns true if no geometry values resp. points stored within the geometry.


distance

public double distance(GM_Object gmo)
The operation "distance" shall return the distance between this GM_Object and another GM_Object. 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 GM_Objects. 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.


translate

public 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.


getCentroid

public GM_Point getCentroid()
The operation "centroid" shall return the mathematical centroid for this GM_Object. 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.


getConvexHull

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


getBuffer

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


contains

public boolean contains(GM_Object gmo)
The Boolean valued operation "contains" shall return TRUE if this GM_Object contains another GM_Object.


contains

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


intersects

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


union

public GM_Object union(GM_Object gmo)
The "union" operation shall return the set theoretic union of this GM_Object and the passed GM_Object.


intersection

public GM_Object intersection(GM_Object gmo)
The "intersection" operation shall return the set theoretic intersection of this GM_Object and the passed GM_Object.


difference

public GM_Object difference(GM_Object gmo)
The "difference" operation shall return the set theoretic difference of this GM_Object and the passed GM_Object.


isWithinDistance

public boolean isWithinDistance(GM_Object gmo,
                                double distance)