|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.geometry.linearization.CurveLinearizer
public class CurveLinearizer
Provides methods for the linearization of Curve
s and CurveSegment
s.
Currently, the following CurveSegment
variants are handled:
Constructor Summary | |
---|---|
CurveLinearizer(GeometryFactory geomFac)
Creates a new CurveLinearizer instance. |
Method Summary | |
---|---|
static boolean |
areCollinear(Point p0,
Point p1,
Point p2)
Tests if the given three points are collinear. |
Curve |
linearize(Curve curve,
LinearizationCriterion crit)
Returns a linearized version of the given Curve geometry. |
LineStringSegment |
linearize(CurveSegment segment,
LinearizationCriterion crit)
Returns a linearized version (i.e. a LineStringSegment ) of the given CurveSegment . |
LineStringSegment |
linearizeArc(Arc arc,
LinearizationCriterion crit)
Returns a linearized version (i.e. a LineStringSegment ) of the given Arc . |
LineStringSegment |
linearizeArcString(ArcString arcString,
LinearizationCriterion crit)
Returns a linearized version (i.e. a LineStringSegment ) of the given ArcString . |
LineStringSegment |
linearizeCubicSpline(CubicSpline spline,
LinearizationCriterion crit)
Returns a linearized version (i.e. a LineStringSegment ) of the given CubicSpline . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CurveLinearizer(GeometryFactory geomFac)
CurveLinearizer
instance.
geomFac
- geometry factory to be used for creating LineString
s and LineStringSegments
, must not be null
Method Detail |
---|
public Curve linearize(Curve curve, LinearizationCriterion crit)
Curve
geometry.
NOTE: This method respects the semantic difference between Curve
and Ring
geometries: if the
input is a Ring
, a ring geometry will be returned.
curve
- curve to be linearized, must not be null
crit
- linearization criterion, must not be null
null
public LineStringSegment linearize(CurveSegment segment, LinearizationCriterion crit)
LineStringSegment
) of the given CurveSegment
.
segment
- segment to be linearized, must not be null
crit
- determines the interpolation quality / number of interpolation points, must not be null
null
public LineStringSegment linearizeArc(Arc arc, LinearizationCriterion crit)
LineStringSegment
) of the given Arc
.
If the three control points p0
, p1
and p2
of the arc are collinear, i.e.
on a straight line, the behaviour depends on the type of Arc
:
arc
- segment to be linearized, must not be null
crit
- determines the interpolation quality / number of interpolation points, must not be null
null
public LineStringSegment linearizeArcString(ArcString arcString, LinearizationCriterion crit)
LineStringSegment
) of the given ArcString
.
If one of the arc elements is collinear, it will be added as a straight segment.
arcString
- curve segment to be linearized, must not be null
crit
- determines the interpolation quality / number of interpolation points, must not be null
null
public LineStringSegment linearizeCubicSpline(CubicSpline spline, LinearizationCriterion crit)
LineStringSegment
) of the given CubicSpline
.
A cubic spline consists of n polynomials of degree 3: Sj(x) = aj + bj*(x-xj) + cj*(x-xj)2 + dj*(x-xj)3; that acts upon the interval [xj,xj+1], 0 <=j< n.
The algorithm for generating points on a spline defined with only control points and starting/ending tangents can be found at http://persson.berkeley.edu/128A/lec14-2x3.pdf (last visited 19/08/09)
spline
- curve segment to be linearized, must not be null
crit
- determines the interpolation quality / number of interpolation points, must not be null
null
public static boolean areCollinear(Point p0, Point p1, Point p2)
NOTE: Only this method should be used throughout the whole linearization process for testing collinearity to avoid inconsistent results (the necessary EPSILON would differ).
p0
- first point, must not be null
p1
- second point, must not be null
p2
- third point, must not be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |