public class MLineString extends LineString implements MGeometry
CONSTANT, DECREASING, INCREASING, NON_MONOTONE
Constructor and Description |
---|
MLineString(CoordinateSequence points,
GeometryFactory factory) |
Modifier and Type | Method and Description |
---|---|
Geometry |
asGeometry()
Returns this
MGeometry as a Geometry . |
java.lang.Object |
clone() |
protected void |
geometryChangedAction() |
MCoordinate |
getClosestPoint(Coordinate co,
double tolerance) |
Coordinate |
getCoordinateAtM(double m)
Returns the Coordinate along the Geometry at the measure value
|
CoordinateSequence[] |
getCoordinatesBetween(double fromM,
double toM)
Returns the coordinatesequence(s) containing all coordinates between the
begin and end measures.
|
java.lang.String |
getGeometryType() |
double |
getMatCoordinate(Coordinate c,
double tolerance)
Returns the measure value at the Coordinate
|
double |
getMatN(int n)
get the measure of the specified coordinate
|
double |
getMaxM()
Returns the maximum M-value of the MGeometry
|
int |
getMeasureDirection()
determine the direction of the measures w.r.t. the direction of the line
|
double[] |
getMeasures() |
double |
getMinM()
Returns the minimum M-value of the MGeometry
|
double |
getMLength()
Returns the measure length of the segment.
|
void |
interpolate(double beginMeasure,
double endMeasure)
Assigns the first coordinate in the CoordinateSequence to the
beginMeasure and the last coordinate in the
CoordinateSequence to the endMeasure . |
boolean |
isMonotone(boolean strict)
Indicates whether the MLineString has monotone increasing or decreasing
M-values
|
void |
measureOnLength(boolean keepBeginMeasure)
Builds measures along the Geometry based on the length from the beginning
(first coordinate) of the Geometry.
|
void |
reverseMeasures()
This method reverses the measures assigned to the Coordinates in the
CoordinateSequence without modifying the positional (x,y,z) values.
|
void |
setMeasureAtIndex(int index,
double m) |
void |
shiftMeasure(double amount)
Shift all measures by the amount parameter.
|
java.lang.String |
toString() |
MLineString |
unionM(MLineString l) |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFactory
public MLineString(CoordinateSequence points, GeometryFactory factory)
public java.lang.Object clone()
protected void geometryChangedAction()
public MCoordinate getClosestPoint(Coordinate co, double tolerance) throws MGeometryException
co
- input coordinate in the neighbourhood of the MLineStringtolerance
- max. distance that co may be from this MLineStringMGeometryException
public Coordinate getCoordinateAtM(double m) throws MGeometryException
MGeometry
getCoordinateAtM
in interface MGeometry
m
- measure valueMGeometryException
- when MGeometry is not monotonepublic java.lang.String getGeometryType()
public double getMatCoordinate(Coordinate c, double tolerance) throws MGeometryException
MGeometry
getMatCoordinate
in interface MGeometry
c
- the Coordinate for which the measure value is soughttolerance
- distance to the MGeometry within which Coordinate c has to lieMGeometryException
- when this MGeometry is not monotonepublic double getMatN(int n)
n
- index of the coordinatepublic double getMaxM()
MGeometry
public CoordinateSequence[] getCoordinatesBetween(double fromM, double toM) throws MGeometryException
MGeometry
getCoordinatesBetween
in interface MGeometry
fromM
- begin measuretoM
- end measureMGeometryException
- when this MGeometry is not monotonepublic int getMeasureDirection()
public double[] getMeasures()
public double getMinM()
MGeometry
public void interpolate(double beginMeasure, double endMeasure)
beginMeasure
and the last coordinate in the
CoordinateSequence to the endMeasure
. Measure values for
intermediate coordinates are then interpolated proportionally based on
their 2d offset of the overall 2d length of the LineString.
If the beginMeasure and endMeasure values are equal it is assumed that
all intermediate coordinates shall be the same value.beginMeasure
- Measure value for first coordinateendMeasure
- Measure value for last coordinatepublic double getMLength()
public boolean isMonotone(boolean strict)
isMonotone
in interface MGeometry
true if MLineString is empty or M-values are increasing (NaN) values, false otherwise
public Geometry asGeometry()
MGeometry
MGeometry
as a Geometry
.
Modifying the returned Geometry
will result in internal state changes.asGeometry
in interface MGeometry
public void measureOnLength(boolean keepBeginMeasure)
MGeometry
measureOnLength
in interface MGeometry
keepBeginMeasure
- -
if true, the measure of the first coordinate is maintained and
used as start value, unless this measure is Double.NaNpublic void reverseMeasures()
public void setMeasureAtIndex(int index, double m)
public void shiftMeasure(double amount)
amount
- the positive or negative amount by which to shift the measures
in the CoordinateSequence.public java.lang.String toString()
public MLineString unionM(MLineString l) throws MGeometryException
MGeometryException