public class MeasureInterpolatingVisitor<P extends C2D & Measured> extends java.lang.Object implements GeometryVisitor<P>
GeometryVisitor that derives a Geometry
by interpolating on the measure values of the visited Geometries.
Interpolation is used to determine any points on the 1-dimensional geometry with an m coordinate value between SM and EM inclusively. The implementation-defined interpolation algorithm is used to estimate values between measured values, usually using a mathematical function. For example, given a measure of 6 and a 2-point linestring where the m coordinate value of the start point is 4 and the m coordinate value of the end point is 8, since 6 is halfway between 4 and 8, the interpolation algorithm would be a point on the linestring halfway between the start and end points.
| Modifier and Type | Field and Description |
|---|---|
private PositionSequenceBuilder<P> |
currentBuilder |
private double |
endMeasure |
private Geometry<P> |
geometry |
private static java.lang.String |
INVALID_TYPE_MSG |
private java.util.List<PositionSequence<P>> |
positionSequences |
private boolean |
sequenceIsEmpty |
private double |
startMeasure |
| Constructor and Description |
|---|
MeasureInterpolatingVisitor(Geometry<P> geometry,
double startMeasure,
double endMeasure) |
| Modifier and Type | Method and Description |
|---|---|
private P |
addIfNotEqualLast(P lastPoint,
P newPnt) |
private CoordinateReferenceSystem<P> |
getCrs() |
private P |
interpolate(P p0,
P p1,
double r) |
Geometry<P> |
result() |
private void |
startNewPointSequenceIfNotEmpty() |
void |
visit(GeometryCollection collection)
Visits a
GeometryCollection. |
void |
visit(LineString<P> lineString)
Visits a
LineString. |
void |
visit(Point<P> point)
Visits a
Point |
void |
visit(Polygon polygon)
Visits a
Polygon. |
private static final java.lang.String INVALID_TYPE_MSG
private final double startMeasure
private final double endMeasure
private final java.util.List<PositionSequence<P extends C2D & Measured>> positionSequences
private PositionSequenceBuilder<P extends C2D & Measured> currentBuilder
private boolean sequenceIsEmpty
public void visit(Point<P> point)
GeometryVisitorPointvisit in interface GeometryVisitor<P extends C2D & Measured>public void visit(LineString<P> lineString)
GeometryVisitorLineString.visit in interface GeometryVisitor<P extends C2D & Measured>private void startNewPointSequenceIfNotEmpty()
public void visit(Polygon polygon)
GeometryVisitorPolygon.visit in interface GeometryVisitor<P extends C2D & Measured>public void visit(GeometryCollection collection)
GeometryVisitorGeometryCollection.
The collection will pass the visitor to it constituent parts.
visit in interface GeometryVisitor<P extends C2D & Measured>private CoordinateReferenceSystem<P> getCrs()