deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.model.spatialschema
Class SurfaceImpl

java.lang.Object
  extended by org.deegree.model.spatialschema.GeometryImpl
      extended by org.deegree.model.spatialschema.PrimitiveImpl
          extended by org.deegree.model.spatialschema.OrientablePrimitiveImpl
              extended by org.deegree.model.spatialschema.OrientableSurfaceImpl
                  extended by org.deegree.model.spatialschema.SurfaceImpl
All Implemented Interfaces:
java.io.Serializable, GenericSurface, Geometry, OrientablePrimitive, OrientableSurface, Primitive, Surface

public class SurfaceImpl
extends OrientableSurfaceImpl
implements Surface, GenericSurface, java.io.Serializable

default implementation of the Surface interface from package deegree.model.spatialschema.

for simplicity of the implementation it is assumed that a surface is build from just one surface patch. this isn't completely conform to the ISO 19107 and the OGC GAIA specification but sufficient for most applications.

It will be extended to fulfill the complete specification as soon as possible.

Version:
05.04.2002
Author:
Andreas Poth
See Also:
Serialized Form

Field Summary
protected  SurfacePatch[] patch
           
 
Fields inherited from class org.deegree.model.spatialschema.OrientablePrimitiveImpl
orientation
 
Fields inherited from class org.deegree.model.spatialschema.GeometryImpl
boundary, centroid, convexHull, crs, empty, envelope, mute, valid
 
Fields inherited from interface org.deegree.model.spatialschema.Geometry
BUFFER_CAP_BUTT, BUFFER_CAP_ROUND, BUFFER_CAP_SQUARE
 
Constructor Summary
protected SurfaceImpl(char orientation, SurfaceBoundary boundary)
          initializes the surface submitting the orientation and the surfaces boundary.
protected SurfaceImpl(char orientation, SurfacePatch surfacePatch)
          initializes the surface submitting the orientation and one surface patch.
protected SurfaceImpl(char orientation, SurfacePatch[] surfacePatches)
          initializes the surface submitting the orientation and one surface patch.
protected SurfaceImpl(SurfaceBoundary boundary)
          initializes the surface with default orientation submitting the surfaces boundary
protected SurfaceImpl(SurfacePatch surfacePatch)
          initializes the surface with default orientation submitting one surface patch.
protected SurfaceImpl(SurfacePatch[] surfacePatches)
          initializes the surface with default orientation submitting one surface patch.
protected SurfaceImpl(SurfacePatch[] surfacePatches, CoordinateSystem crs)
          initializes the surface with default orientation submitting one surface patch.
 
Method Summary
protected  void calculateParam()
          calculates area, centroid and the envelope of the surface
 java.lang.Object clone()
           
 boolean contains(Geometry gmo)
          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.
 boolean equals(java.lang.Object other)
          checks if this surface is completly equal to the submitted geometry
 double getArea()
          The operation "area" shall return the area of this GenericSurface.
 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.
 int getDimension()
          The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension.
 int getNumberOfSurfacePatches()
           
 double getPerimeter()
          returns the length of all boundaries of the surface in a reference system appropriate for measuring distances.
 SurfaceBoundary getSurfaceBoundary()
          returns the boundary of the surface
 SurfacePatch getSurfacePatchAt(int index)
           
 boolean intersects(Geometry gmo)
          The boolean valued operation "intersects" shall return TRUE if this SurfaceImpl intersects with the given Geometry.
 java.lang.String toString()
           
 void translate(double[] d)
          translate each point of the surface with the values of the submitted double array.
 
Methods inherited from class org.deegree.model.spatialschema.OrientablePrimitiveImpl
getOrientation, setOrientation
 
Methods inherited from class org.deegree.model.spatialschema.GeometryImpl
difference, distance, getBoundary, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isEmpty, isValid, isWithinDistance, setCoordinateSystem, setEmpty, setTolerance, setValid, union
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.model.spatialschema.OrientablePrimitive
getOrientation, setOrientation
 
Methods inherited from interface org.deegree.model.spatialschema.Geometry
difference, distance, getBoundary, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isEmpty, isWithinDistance, setTolerance, union
 
Methods inherited from interface org.deegree.model.spatialschema.GenericSurface
getEnvelope
 

Field Detail

patch

protected SurfacePatch[] patch
Constructor Detail

SurfaceImpl

protected SurfaceImpl(SurfacePatch surfacePatch)
               throws GeometryException
initializes the surface with default orientation submitting one surface patch.

Parameters:
surfacePatch - patches of the surface.
Throws:
GeometryException - will be thrown if orientation is invalid

SurfaceImpl

protected SurfaceImpl(SurfacePatch[] surfacePatches)
               throws GeometryException
initializes the surface with default orientation submitting one surface patch.

Parameters:
surfacePatches - patches of the surface.
Throws:
GeometryException - will be thrown if orientation is invalid

SurfaceImpl

protected SurfaceImpl(SurfacePatch[] surfacePatches,
                      CoordinateSystem crs)
               throws GeometryException
initializes the surface with default orientation submitting one surface patch.

Parameters:
surfacePatches - patches of the surface.
crs -
Throws:
GeometryException - will be thrown if orientation is invalid

SurfaceImpl

protected SurfaceImpl(char orientation,
                      SurfacePatch surfacePatch)
               throws GeometryException
initializes the surface submitting the orientation and one surface patch.

Parameters:
orientation - of the surface
surfacePatch - patches of the surface.
Throws:
GeometryException - will be thrown if orientation is invalid

SurfaceImpl

protected SurfaceImpl(char orientation,
                      SurfacePatch[] surfacePatches)
               throws GeometryException
initializes the surface submitting the orientation and one surface patch.

Parameters:
orientation - of the surface
surfacePatches - patches of the surface.
Throws:
GeometryException - will be thrown if orientation is invalid

SurfaceImpl

protected SurfaceImpl(SurfaceBoundary boundary)
               throws GeometryException
initializes the surface with default orientation submitting the surfaces boundary

Parameters:
boundary - boundary of the surface
Throws:
GeometryException - will be thrown if orientation is invalid

SurfaceImpl

protected SurfaceImpl(char orientation,
                      SurfaceBoundary boundary)
               throws GeometryException
initializes the surface submitting the orientation and the surfaces boundary.

Parameters:
orientation - of the surface
boundary - boundary of the surface
Throws:
GeometryException - will be thrown if orientation is invalid
Method Detail

calculateParam

protected void calculateParam()
calculates area, centroid and the envelope of the surface

Specified by:
calculateParam in class GeometryImpl

getPerimeter

public double getPerimeter()
returns the length of all boundaries of the surface in a reference system appropriate for measuring distances.

Specified by:
getPerimeter in interface GenericSurface
Returns:
the length of all boundaries of the surface in a reference system appropriate for measuring distances.

getArea

public double getArea()
The operation "area" shall return the area of this GenericSurface. The area of a 2 dimensional geometric object shall be a numeric measure of its surface area Since area is an accumulation (integral) of the product of two distances, its return value shall be in a unit of measure appropriate for measuring distances squared.

Specified by:
getArea in interface GenericSurface
Returns:
the area

getSurfaceBoundary

public SurfaceBoundary getSurfaceBoundary()
Description copied from interface: OrientableSurface
returns the boundary of the surface

Specified by:
getSurfaceBoundary in interface OrientableSurface
Returns:
the boundary of the surface

getNumberOfSurfacePatches

public int getNumberOfSurfacePatches()
Specified by:
getNumberOfSurfacePatches in interface Surface
Returns:
the number of patches building the surface

getSurfacePatchAt

public SurfacePatch getSurfacePatchAt(int index)
                               throws GeometryException
Specified by:
getSurfacePatchAt in interface Surface
Parameters:
index - the index to look for.
Returns:
the surface patch at the submitted index.
Throws:
GeometryException - if the Index is negative.

equals

public boolean equals(java.lang.Object other)
checks if this surface is completly equal to the submitted geometry

Overrides:
equals in class GeometryImpl
Parameters:
other - object to compare to
Returns:
true if the objects are equal, else false

getDimension

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

Specified by:
getDimension in interface Geometry
Returns:
the for this geometry defined dimension.

getCoordinateDimension

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

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

clone

public java.lang.Object clone()
Overrides:
clone in class GeometryImpl
Returns:
a shallow copy of the geometry

translate

public void translate(double[] d)
translate each point of the surface with the values of the submitted double array.

Specified by:
translate in interface Geometry
Overrides:
translate in class GeometryImpl
Parameters:
d - vector to translate the geometry with

intersects

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

Specified by:
intersects in interface Geometry
Overrides:
intersects in class GeometryImpl
Parameters:
gmo - the Geometry to test for intersection
Returns:
true if the Geometry intersects with this

contains

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

Specified by:
contains in interface Geometry
Overrides:
contains in class GeometryImpl
Parameters:
position - Position to test (whether is is contained)
Returns:
true if the given object is contained, else false

contains

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

Specified by:
contains in interface Geometry
Overrides:
contains in class GeometryImpl
Parameters:
gmo - the Geometry to test (whether is is contained)
Returns:
true if the given object is contained, else false

toString

public java.lang.String toString()
Overrides:
toString in class GeometryImpl
Returns:
the Stringrepresenation of this surface.

deegree 2.5 (2011/06/29 09:44 build-8-official)

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