deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.geometry.standard.primitive
Class DefaultCurve

java.lang.Object
  extended by org.deegree.geometry.standard.AbstractDefaultGeometry
      extended by org.deegree.geometry.standard.primitive.DefaultCurve
All Implemented Interfaces:
Geometry, Curve, GeometricPrimitive, GMLObject
Direct Known Subclasses:
DefaultLineString

public class DefaultCurve
extends AbstractDefaultGeometry
implements Curve

Default implementation of Curve.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.deegree.geometry.primitive.Curve
Curve.CurveType
 
Nested classes/interfaces inherited from interface org.deegree.geometry.primitive.GeometricPrimitive
GeometricPrimitive.PrimitiveType
 
Nested classes/interfaces inherited from interface org.deegree.geometry.Geometry
Geometry.GeometryType
 
Field Summary
 
Fields inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
crs, id, jtsFactory, jtsGeometry, pm
 
Constructor Summary
DefaultCurve(String id, CRS crs, PrecisionModel pm, List<CurveSegment> segments)
          Creates a new DefaultCurve instance from the given parameters.
 
Method Summary
protected  com.vividsolutions.jts.geom.LineString buildJTSGeometry()
           
 LineString getAsLineString()
          Returns a linear interpolated representation of the curve.
 Pair<Point,Point> getBoundary()
          The boundary of a curve is the set of points at either end of the curve.
 Points getControlPoints()
          Convenience method for accessing the control points of linear interpolated curves.
 int getCoordinateDimension()
          Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.
 List<CurveSegment> getCurveSegments()
          Returns the segments that constitute this curve.
 Curve.CurveType getCurveType()
          Returns the type of curve.
 Point getEndPoint()
          Returns the end point of the curve.
 Geometry.GeometryType getGeometryType()
          Must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY.
 Measure getLength(Unit requestedUnit)
           
 GeometricPrimitive.PrimitiveType getPrimitiveType()
          Must always return GeometricPrimitive.PrimitiveType.Curve.
 Point getStartPoint()
          Returns the start point of the curve.
 boolean isClosed()
          Returns whether the curve forms a closed loop.
 
Methods inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
contains, createFromJTS, crosses, equals, getAsDefaultGeometry, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getDifference, getDistance, getEnvelope, getGMLProperties, getId, getIntersection, getJTSGeometry, getPrecision, getUnion, intersects, isBeyond, isDisjoint, isWithin, isWithinDistance, overlaps, setCoordinateSystem, setGMLProperties, setId, setPrecision, toString, touches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.geometry.Geometry
contains, crosses, equals, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getDifference, getDistance, getEnvelope, getId, getIntersection, getPrecision, getUnion, intersects, isBeyond, isDisjoint, isWithin, isWithinDistance, overlaps, setCoordinateSystem, setGMLProperties, setId, setPrecision, touches
 
Methods inherited from interface org.deegree.gml.GMLObject
getGMLProperties
 

Constructor Detail

DefaultCurve

public DefaultCurve(String id,
                    CRS crs,
                    PrecisionModel pm,
                    List<CurveSegment> segments)
Creates a new DefaultCurve instance from the given parameters.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
pm - precision model, may be null
segments - segments that constitute the curve (never null)
Method Detail

getCoordinateDimension

public int getCoordinateDimension()
Description copied from interface: Geometry
Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.

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

getBoundary

public Pair<Point,Point> getBoundary()
Description copied from interface: Curve
The boundary of a curve is the set of points at either end of the curve. If the curve is a cycle, the two ends are identical, and the curve (if topologically closed) is considered to not have a boundary.

Specified by:
getBoundary in interface Curve
Returns:
boundary of a curve. If a curve does not have a boundary because it is closed an empty List shall be retruned

getCurveSegments

public List<CurveSegment> getCurveSegments()
Description copied from interface: Curve
Returns the segments that constitute this curve.

Specified by:
getCurveSegments in interface Curve
Returns:
the segments that constitute this curve

getLength

public Measure getLength(Unit requestedUnit)
Specified by:
getLength in interface Curve
Returns:
length of the curve

isClosed

public boolean isClosed()
Description copied from interface: Curve
Returns whether the curve forms a closed loop.

Specified by:
isClosed in interface Curve
Returns:
true, if the curve forms a closed loop, false otherwise

getAsLineString

public LineString getAsLineString()
Description copied from interface: Curve
Returns a linear interpolated representation of the curve.

NOTE: This method is only safe to use when the curve is a LineString or LinearRing or it only consists of LineStringSegments. In any other case it will fail.

Specified by:
getAsLineString in interface Curve
Returns:
curve as a linestring

getCurveType

public Curve.CurveType getCurveType()
Description copied from interface: Curve
Returns the type of curve.

Specified by:
getCurveType in interface Curve
Returns:
the type of curve

getStartPoint

public Point getStartPoint()
Description copied from interface: Curve
Returns the start point of the curve.

Specified by:
getStartPoint in interface Curve
Returns:
the start point of the curve

getEndPoint

public Point getEndPoint()
Description copied from interface: Curve
Returns the end point of the curve.

Specified by:
getEndPoint in interface Curve
Returns:
the end point of the curve

getPrimitiveType

public GeometricPrimitive.PrimitiveType getPrimitiveType()
Description copied from interface: Curve
Must always return GeometricPrimitive.PrimitiveType.Curve.

Specified by:
getPrimitiveType in interface Curve
Specified by:
getPrimitiveType in interface GeometricPrimitive
Returns:
GeometricPrimitive.PrimitiveType.Curve

getGeometryType

public Geometry.GeometryType getGeometryType()
Description copied from interface: GeometricPrimitive
Must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY.

Specified by:
getGeometryType in interface Geometry
Specified by:
getGeometryType in interface GeometricPrimitive
Returns:
must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY

getControlPoints

public Points getControlPoints()
Description copied from interface: Curve
Convenience method for accessing the control points of linear interpolated curves.

NOTE: This method is only safe to use when the curve is a LineString or LinearRing or it only consists of LineStringSegments. In any other case it will fail.

Specified by:
getControlPoints in interface Curve
Returns:
the control points

buildJTSGeometry

protected com.vividsolutions.jts.geom.LineString buildJTSGeometry()
Overrides:
buildJTSGeometry in class AbstractDefaultGeometry

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

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

]]>