|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vividsolutions.jts.geom.Geometry
com.vividsolutions.jts.geom.LineString
org.hibernate.spatial.jts.mgeom.MLineString
public class MLineString
An implementation of the LineString class with the addition that the containing CoordinateSequence can carry measure. Note that this is not a strict requirement of the class, and can interact with non-measure geometries for JTS topological comparisons regardless.
Field Summary |
---|
Fields inherited from interface org.hibernate.spatial.jts.mgeom.MGeometry |
---|
CONSTANT, DECREASING, INCREASING, NON_MONOTONE |
Constructor Summary | |
---|---|
MLineString(com.vividsolutions.jts.geom.CoordinateSequence points,
com.vividsolutions.jts.geom.GeometryFactory factory)
|
Method Summary | |
---|---|
com.vividsolutions.jts.geom.Geometry |
asGeometry()
Returns this MGeometry as a Geometry . |
java.lang.Object |
clone()
|
MCoordinate |
getClosestPoint(com.vividsolutions.jts.geom.Coordinate co,
double tolerance)
|
com.vividsolutions.jts.geom.Coordinate |
getCoordinateAtM(double m)
Returns the Coordinate along the Geometry at the measure value |
com.vividsolutions.jts.geom.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(com.vividsolutions.jts.geom.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. |
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)
|
Methods inherited from class com.vividsolutions.jts.geom.LineString |
---|
apply, apply, apply, apply, equalsExact, getBoundary, getBoundaryDimension, getCoordinate, getCoordinateN, getCoordinates, getCoordinateSequence, getDimension, getEndPoint, getLength, getNumPoints, getPointN, getStartPoint, isClosed, isCoordinate, isEmpty, isRing, normalize, reverse |
Methods inherited from class com.vividsolutions.jts.geom.Geometry |
---|
buffer, buffer, buffer, compareTo, compareTo, contains, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, equals, equals, equalsExact, equalsNorm, equalsTopo, geometryChanged, getArea, getCentroid, getEnvelope, getEnvelopeInternal, getFactory, getGeometryN, getInteriorPoint, getNumGeometries, getPrecisionModel, getSRID, getUserData, hashCode, intersection, intersects, isRectangle, isSimple, isValid, isWithinDistance, norm, overlaps, relate, relate, setSRID, setUserData, symDifference, toText, touches, union, union, within |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.hibernate.spatial.jts.mgeom.MGeometry |
---|
getFactory |
Constructor Detail |
---|
public MLineString(com.vividsolutions.jts.geom.CoordinateSequence points, com.vividsolutions.jts.geom.GeometryFactory factory)
Method Detail |
---|
public java.lang.Object clone()
clone
in class com.vividsolutions.jts.geom.LineString
public MCoordinate getClosestPoint(com.vividsolutions.jts.geom.Coordinate co, double tolerance) throws MGeometryException
co
- input coordinate in the neighbourhood of the MLineStringtolerance
- max. distance that co may be from this MLineString
MGeometryException
public com.vividsolutions.jts.geom.Coordinate getCoordinateAtM(double m) throws MGeometryException
MGeometry
getCoordinateAtM
in interface MGeometry
m
- measure value
MGeometryException
- when MGeometry is not monotonepublic java.lang.String getGeometryType()
getGeometryType
in class com.vividsolutions.jts.geom.LineString
public double getMatCoordinate(com.vividsolutions.jts.geom.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 lie
MGeometryException
- when this MGeometry is not monotonepublic double getMatN(int n)
n
- index of the coordinate
public double getMaxM()
MGeometry
getMaxM
in interface MGeometry
public com.vividsolutions.jts.geom.CoordinateSequence[] getCoordinatesBetween(double fromM, double toM) throws MGeometryException
MGeometry
getCoordinatesBetween
in interface MGeometry
fromM
- begin measuretoM
- end measure
MGeometryException
- when this MGeometry is not monotonepublic int getMeasureDirection()
public double[] getMeasures()
public double getMinM()
MGeometry
getMinM
in interface 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 com.vividsolutions.jts.geom.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()
toString
in class com.vividsolutions.jts.geom.Geometry
public MLineString unionM(MLineString l) throws MGeometryException
MGeometryException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |