Package org.gvsig.fmap.geom.jts.mgeom
Interface MGeometry
- All Superinterfaces:
Cloneable,Serializable
- All Known Implementing Classes:
MLineString,MultiMLineString
Defines geometries that carry measures in their CoordinateSequence.
- Author:
- Karel Maesen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMeasures are constant across the Geometrystatic final intMeasures are decreasing in the direction of the MGeometrystatic final intMeasures are increasing in the direction of the MGeometrystatic final intMeasures are not monotone along the Geometry -
Method Summary
Modifier and TypeMethodDescriptioncom.vividsolutions.jts.geom.GeometryReturns thisMGeometryas aGeometry.com.vividsolutions.jts.geom.CoordinategetCoordinateAtM(double m) Returns the Coordinate along the Geometry at the measure valuecom.vividsolutions.jts.geom.CoordinateSequence[]getCoordinatesBetween(double begin, double end) Returns the coordinatesequence(s) containing all coordinates between the begin and end measures.com.vividsolutions.jts.geom.GeometryFactoryReturns the GeometryFactory of the MGeometrydoublegetMatCoordinate(com.vividsolutions.jts.geom.Coordinate c, double tolerance) Returns the measure value at the CoordinatedoublegetMaxM()Returns the maximum M-value of the MGeometrydoublegetMinM()Returns the minimum M-value of the MGeometrybooleanisMonotone(boolean strict) Determine whether the LRS measures (not the x,y,z coordinates) in the Coordinate sequence of the geometry is Monotone.voidmeasureOnLength(boolean keepBeginMeasure) Builds measures along the Geometry based on the length from the beginning (first coordinate) of the Geometry.
-
Field Details
-
INCREASING
static final int INCREASINGMeasures are increasing in the direction of the MGeometry- See Also:
-
CONSTANT
static final int CONSTANTMeasures are constant across the Geometry- See Also:
-
DECREASING
static final int DECREASINGMeasures are decreasing in the direction of the MGeometry- See Also:
-
NON_MONOTONE
static final int NON_MONOTONEMeasures are not monotone along the Geometry- See Also:
-
-
Method Details
-
getMatCoordinate
double getMatCoordinate(com.vividsolutions.jts.geom.Coordinate c, double tolerance) throws MGeometryException Returns the measure value at the Coordinate- Parameters:
c- the Coordinate for which the measure value is soughttolerance- distance to the MGeometry within which Coordinate c has to lie- Returns:
- the measure value if Coordinate c is within tolerance of the Geometry, else Double.NaN When the geometry is a ring or is self-intersecting more coordinates may be determined by one coordinate. In that case, the lowest measure is returned.
- Throws:
MGeometryException- when this MGeometry is not monotone
-
measureOnLength
void measureOnLength(boolean keepBeginMeasure) Builds measures along the Geometry based on the length from the beginning (first coordinate) of the Geometry.- Parameters:
keepBeginMeasure- - if true, the measure of the first coordinate is maintained and used as start value, unless this measure is Double.NaN
-
getCoordinateAtM
Returns the Coordinate along the Geometry at the measure value- Parameters:
m- measure value- Returns:
- the Coordinate if m is on the MGeometry otherwise null
- Throws:
MGeometryException- when MGeometry is not monotone
-
getCoordinatesBetween
com.vividsolutions.jts.geom.CoordinateSequence[] getCoordinatesBetween(double begin, double end) throws MGeometryException Returns the coordinatesequence(s) containing all coordinates between the begin and end measures.- Parameters:
begin- begin measureend- end measure- Returns:
- an array containing all coordinatesequences in order between begin and end. Each CoordinateSequence covers a contiguous stretch of the MGeometry.
- Throws:
MGeometryException- when this MGeometry is not monotone
-
getFactory
com.vividsolutions.jts.geom.GeometryFactory getFactory()Returns the GeometryFactory of the MGeometry- Returns:
- the GeometryFactory of this MGeometry
-
getMinM
double getMinM()Returns the minimum M-value of the MGeometry- Returns:
- the minimum M-value
-
getMaxM
double getMaxM()Returns the maximum M-value of the MGeometry- Returns:
- the maximum M-value
-
isMonotone
boolean isMonotone(boolean strict) Determine whether the LRS measures (not the x,y,z coordinates) in the Coordinate sequence of the geometry is Monotone. Monotone implies that all measures in a sequence of coordinates are consecutively increasing, decreasing or equal according to the definition of the implementing geometry. Monotonicity is a pre-condition for most operations on MGeometries. The following are examples on Monotone measure sequences on a line string:- [0,1,2,3,4] - Monotone Increasing
- [4,3,2,1] - Monotone Decreasing
- [0,1,1,2,3] - Non-strict Monotone Increasing
- [5,3,3,0] - Non-strict Monotone Decreasing
- Returns:
- true if the coordinates in the CoordinateSequence of the geometry are monotone.
-
asGeometry
com.vividsolutions.jts.geom.Geometry asGeometry()Returns thisMGeometryas aGeometry. Modifying the returnedGeometrywill result in internal state changes.- Returns:
- this object as a Geometry.
-