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

org.deegree.model.spatialschema
Class CurveImpl

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.OrientableCurveImpl
                  extended by org.deegree.model.spatialschema.CurveImpl
All Implemented Interfaces:
java.io.Serializable, Curve, GenericCurve, Geometry, OrientableCurve, OrientablePrimitive, Primitive

public class CurveImpl
extends OrientableCurveImpl
implements Curve, GenericCurve

default implementation of

Version:
$Revision: 23675 $ $Date: 2010-04-19 11:20:41 +0200 (Mo, 19 Apr 2010) $
Author:
Andreas Poth
See Also:
Curve, Serialized Form

Field Summary
protected  java.util.ArrayList<CurveSegment> segments
           
 
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 CurveImpl(char orientation, CurveSegment[] segments)
          initialize the curve by submitting a spatial reference system, an array of curve segments and the orientation of the curve
protected CurveImpl(CurveSegment segments)
          initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'
protected CurveImpl(CurveSegment[] segments)
          initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'
protected CurveImpl(CurveSegment[] segments, CoordinateSystem crs)
          initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'
 
Method Summary
protected  void calculateParam()
          recalculates internal parameters
 java.lang.Object clone()
           
 boolean equals(java.lang.Object other)
          checks if this curve is completely equal to the submitted geometry
 LineString getAsLineString()
          returns the curve as LineString. if there isn't a curve segment within the curve null will be returned
 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.
 CurveBoundary getCurveBoundary()
          returns the boundary of the curve
 CurveSegment getCurveSegmentAt(int index)
          returns the curve segment at the submitted index
 CurveSegment[] getCurveSegments()
           
 int getDimension()
          The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension.
 Point getEndPoint()
          returns the last point of the curve.if the curve doesn't contain a segment or the last segment doesn't contain a point null will be returned
 double getLength()
          returns the length of the curve in units of the related spatial reference system
 int getNumberOfCurveSegments()
          returns the number of segments building the curve
 Point getStartPoint()
          returns the first point of the curve. if the curve doesn't contain a segment or the first segment doesn't contain a point null will be returned
 boolean intersects(Geometry gmo)
          The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry.
 boolean isEmpty()
           
 java.lang.String toString()
           
 void translate(double[] d)
          translate each point of the curve with the values of the submitted double array.
 Geometry union(Geometry other)
          The "union" operation shall return the set theoretic union of this Geometry and the passed Geometry.
 
Methods inherited from class org.deegree.model.spatialschema.OrientablePrimitiveImpl
getOrientation, setOrientation
 
Methods inherited from class org.deegree.model.spatialschema.GeometryImpl
contains, contains, difference, distance, getBoundary, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isValid, isWithinDistance, setCoordinateSystem, setEmpty, setTolerance, setValid
 
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
contains, contains, difference, distance, getBoundary, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isWithinDistance, setTolerance
 

Field Detail

segments

protected java.util.ArrayList<CurveSegment> segments
Constructor Detail

CurveImpl

protected CurveImpl(CurveSegment segments)
             throws GeometryException
initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'

Parameters:
segments - array of CurveSegment
Throws:
GeometryException

CurveImpl

protected CurveImpl(CurveSegment[] segments)
             throws GeometryException
initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'

Parameters:
segments - array of CurveSegment
Throws:
GeometryException

CurveImpl

protected CurveImpl(CurveSegment[] segments,
                    CoordinateSystem crs)
             throws GeometryException
initialize the curve by submitting a spatial reference system and an array of curve segments. the orientation of the curve is '+'

Parameters:
segments - array of CurveSegment
crs -
Throws:
GeometryException

CurveImpl

protected CurveImpl(char orientation,
                    CurveSegment[] segments)
             throws GeometryException
initialize the curve by submitting a spatial reference system, an array of curve segments and the orientation of the curve

Parameters:
segments - array of CurveSegment
orientation - of the curve
Throws:
GeometryException
Method Detail

calculateParam

protected void calculateParam()
Description copied from class: GeometryImpl
recalculates internal parameters

Specified by:
calculateParam in class GeometryImpl

getCurveBoundary

public CurveBoundary getCurveBoundary()
returns the boundary of the curve

Specified by:
getCurveBoundary in interface OrientableCurve
Returns:
the curve boundary of an orientable curve.

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

intersects

public boolean intersects(Geometry gmo)
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.

dummy implementation

Specified by:
intersects in interface Geometry
Overrides:
intersects in class GeometryImpl
Parameters:
gmo - the Geometry to intersect with
Returns:
true if the objects intersects, else false

getLength

public double getLength()
returns the length of the curve in units of the related spatial reference system

Specified by:
getLength in interface GenericCurve
Returns:
the length of the curve in units of the related spatial reference system

getNumberOfCurveSegments

public int getNumberOfCurveSegments()
returns the number of segments building the curve

Specified by:
getNumberOfCurveSegments in interface Curve
Returns:
number of segments

getStartPoint

public Point getStartPoint()
returns the first point of the curve. if the curve doesn't contain a segment or the first segment doesn't contain a point null will be returned

Specified by:
getStartPoint in interface GenericCurve
Returns:
the first point of the curve

getEndPoint

public Point getEndPoint()
returns the last point of the curve.if the curve doesn't contain a segment or the last segment doesn't contain a point null will be returned

Specified by:
getEndPoint in interface GenericCurve
Returns:
the last point of the curve

getAsLineString

public LineString getAsLineString()
                           throws GeometryException
returns the curve as LineString. if there isn't a curve segment within the curve null will be returned

Specified by:
getAsLineString in interface GenericCurve
Returns:
the curve as LineString
Throws:
GeometryException

getCurveSegmentAt

public CurveSegment getCurveSegmentAt(int index)
                               throws GeometryException
returns the curve segment at the submitted index

Specified by:
getCurveSegmentAt in interface Curve
Parameters:
index - index of the curve segment that should be returned
Returns:
segment at passed index position
Throws:
GeometryException - a exception will be thrown if index is smaller than '0' or larger than getNumberOfCurveSegments()-1

getCurveSegments

public CurveSegment[] getCurveSegments()
                                throws GeometryException
Specified by:
getCurveSegments in interface Curve
Returns:
all segments of a Curve
Throws:
GeometryException

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Geometry
Overrides:
isEmpty in class GeometryImpl
Returns:
true if no segment is within the curve

translate

public void translate(double[] d)
translate each point of the curve 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

equals

public boolean equals(java.lang.Object other)
checks if this curve is completely 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

union

public Geometry union(Geometry other)
Description copied from class: GeometryImpl
The "union" operation shall return the set theoretic union of this Geometry and the passed Geometry.

Specified by:
union in interface Geometry
Overrides:
union in class GeometryImpl
Parameters:
other - the Geometry to unify
Returns:
intersection or null, if computation failed

clone

public java.lang.Object clone()
Overrides:
clone in class GeometryImpl

toString

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

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