deegree 2.1 (2007/11/08 09:57 build-328-official)

org.deegree.model.spatialschema
Class SurfacePatchImpl

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

abstract class SurfacePatchImpl
extends Object
implements GenericSurface, Serializable

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

Author:
Andreas Poth, last edited by: $Author: aschmitz $

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(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 Geometry.
 CoordinateSystem getCoordinateSystem()
          returns the coordinate system of the surface patch
 Envelope getEnvelope()
          returns the bounding box of the surface patch
 Position[] getExteriorRing()
          returns a reference to the exterior ring of the surface
 Position[][] getInteriorRings()
          returns a reference to the interior rings of the surface
 SurfaceInterpolation getInterpolation()
          The interpolation determines the surface interpolation mechanism used for this SurfacePatch.
 double getPerimeter()
          returns the length of all boundaries of the surface in a reference system appropriate for measuring distances.
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
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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)
Parameters:
exteriorRing -
interiorRings -
crs -

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


isValid

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


getInterpolation

public SurfaceInterpolation getInterpolation()
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.


getEnvelope

public Envelope getEnvelope()
returns the bounding box of the surface patch

Specified by:
getEnvelope in interface GenericSurface

getExteriorRing

public Position[] getExteriorRing()
returns a reference to the exterior ring of the surface

Returns:
exterior ring as Positions

getInteriorRings

public Position[][] getInteriorRings()
returns a reference to the interior rings of the surface

Returns:
interior rings as Positions

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

getCoordinateSystem

public CoordinateSystem getCoordinateSystem()
returns the coordinate system of the surface patch


equals

public boolean equals(Object other)
Overrides:
equals in class Object
Parameters:
other -
Returns:

getCentroid

public Point getCentroid()
The operation "centroid" shall return the mathematical centroid for this Geometry. The result is not guaranteed to be on the object.


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

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.


toString

public String toString()
Overrides:
toString in class Object

deegree 2.1 (2007/11/08 09:57 build-328-official)

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