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

org.deegree.model.spatialschema
Class SurfacePatchImpl

java.lang.Object
  extended by org.deegree.model.spatialschema.SurfacePatchImpl
All Implemented Interfaces:
java.io.Serializable, GenericSurface, SurfacePatch
Direct Known Subclasses:
PolygonImpl

public abstract class SurfacePatchImpl
extends java.lang.Object
implements GenericSurface, SurfacePatch, java.io.Serializable

default implementation of the SurfacePatch interface from package deegree.model.spatialschema. the class is abstract because it should be specialized by derived classes Polygon for example

Version:
$Revision: 25223 $, $Date: 2010-07-09 09:30:18 +0200 (Fr, 09 Jul 2010) $
Author:
Andreas Poth, last edited by: $Author: apoth $
See Also:
Serialized Form

Field Summary
protected  double area
           
protected  Point centroid
           
protected  CoordinateSystem crs
           
protected  Ring exteriorRing
           
protected  Ring[] interiorRings
           
protected  SurfaceInterpolation interpolation
           
protected  boolean valid
           
 
Constructor Summary
protected SurfacePatchImpl(Ring exteriorRing, Ring[] interiorRings, CoordinateSystem crs)
           
protected SurfacePatchImpl(SurfaceInterpolation interpolation, Position[] exteriorRing, Position[][] interiorRings, CoordinateSystem crs)
          Creates a new SurfacePatchImpl object.
 
Method Summary
protected  Position calculateCentroid(Position[] point)
          calculates the centroid of the surface patch taken from gems iv (modified) this method is only valid for the two-dimensional case.
protected  void calculateParam()
          calculates the centroid and the area of the surface patch
 boolean equals(java.lang.Object other)
           
 double getArea()
          The operation "area" shall return the area of this GenericSurface.
 Point getCentroid()
          The operation "centroid" shall return the mathematical centroid for this surfacepatch.
 CoordinateSystem getCoordinateSystem()
           
 Envelope getEnvelope()
           
 Ring getExterior()
           
 Position[] getExteriorRing()
           
 Ring[] getInterior()
           
 Position[][] getInteriorRings()
           
 SurfaceInterpolation getInterpolation()
          The interpolation determines the surface interpolation mechanism used for this SurfacePatch.
 double getPerimeter()
           
protected  boolean isValid()
          returns true if the calculated parameters of the Geometry are valid and false if they must be recalculated
protected  void setValid(boolean valid)
          invalidates the calculated parameters of the Geometry
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.model.spatialschema.SurfacePatch
contains, intersects
 

Field Detail

crs

protected CoordinateSystem crs

centroid

protected Point centroid

interpolation

protected SurfaceInterpolation interpolation

exteriorRing

protected Ring exteriorRing

interiorRings

protected Ring[] interiorRings

area

protected double area

valid

protected boolean valid
Constructor Detail

SurfacePatchImpl

protected SurfacePatchImpl(Ring exteriorRing,
                           Ring[] interiorRings,
                           CoordinateSystem crs)
                    throws GeometryException
Parameters:
exteriorRing -
interiorRings -
crs -
Throws:
GeometryException

SurfacePatchImpl

protected SurfacePatchImpl(SurfaceInterpolation interpolation,
                           Position[] exteriorRing,
                           Position[][] interiorRings,
                           CoordinateSystem crs)
                    throws GeometryException
Creates a new SurfacePatchImpl object.

Parameters:
interpolation -
exteriorRing -
interiorRings -
crs -
Throws:
GeometryException
Method Detail

setValid

protected void setValid(boolean valid)
invalidates the calculated parameters of the Geometry

Parameters:
valid -

isValid

protected boolean isValid()
returns true if the calculated parameters of the Geometry are valid and false if they must be recalculated

Returns:
true if the calculated parameters of the Geometry are valid and false if they must be recalculated

getInterpolation

public SurfaceInterpolation getInterpolation()
Description copied from interface: SurfacePatch
The interpolation determines the surface interpolation mechanism used for this SurfacePatch. This mechanism uses the control points and control parameters defined in the various subclasses to determine the position of this SurfacePatch.

Specified by:
getInterpolation in interface SurfacePatch
Returns:
the surface interpolation of this surface

getEnvelope

public Envelope getEnvelope()
Specified by:
getEnvelope in interface GenericSurface
Returns:
the bounding box of the surface

getExteriorRing

public Position[] getExteriorRing()
Specified by:
getExteriorRing in interface SurfacePatch
Returns:
the exterior ring of a surfacePatch

getInteriorRings

public Position[][] getInteriorRings()
Specified by:
getInteriorRings in interface SurfacePatch
Returns:
the interior rings of a surfacePatch

getExterior

public Ring getExterior()
Specified by:
getExterior in interface SurfacePatch
Returns:
the exterior ring of a surfacePatch

getInterior

public Ring[] getInterior()
Specified by:
getInterior in interface SurfacePatch
Returns:
the interior rings of a surfacePatch

getPerimeter

public double getPerimeter()
Specified by:
getPerimeter in interface GenericSurface
Returns:
-1

getCoordinateSystem

public CoordinateSystem getCoordinateSystem()
Specified by:
getCoordinateSystem in interface SurfacePatch
Returns:
the coordinate system of the surface patch

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

getCentroid

public Point getCentroid()
Description copied from interface: SurfacePatch
The operation "centroid" shall return the mathematical centroid for this surfacepatch. The result is not guaranteed to be on the object.

Specified by:
getCentroid in interface SurfacePatch
Returns:
the centroid

getArea

public double getArea()
Description copied from interface: GenericSurface
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
Specified by:
getArea in interface SurfacePatch
Returns:
the area

calculateParam

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


calculateCentroid

protected Position calculateCentroid(Position[] point)
calculates the centroid of the surface patch

taken from gems iv (modified)

this method is only valid for the two-dimensional case.

Parameters:
point -
Returns:
the centroid of given positions

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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