org.hibernate.spatial.jts.mgeom
Interface MGeometry

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
MLineString, MultiMLineString

public interface MGeometry
extends java.lang.Cloneable, java.io.Serializable

Defines geometries that carry measures in their CoordinateSequence.


Field Summary
static int CONSTANT
          Measures are constant across the Geometry
static int DECREASING
          Measures are decreasing in the direction of the MGeometry
static int INCREASING
          Measures are increasing in the direction of the MGeometry
static int NON_MONOTONE
          Measures are not monotone along the Geometry
 
Method Summary
 com.vividsolutions.jts.geom.Geometry asGeometry()
          Returns this MGeometry as a Geometry.
 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 begin, double end)
          Returns the coordinatesequence(s) containing all coordinates between the begin and end measures.
 com.vividsolutions.jts.geom.GeometryFactory getFactory()
          Returns the GeometryFactory of the MGeometry
 double getMatCoordinate(com.vividsolutions.jts.geom.Coordinate c, double tolerance)
          Returns the measure value at the Coordinate
 double getMaxM()
          Returns the maximum M-value of the MGeometry
 double getMinM()
          Returns the minimum M-value of the MGeometry
 boolean isMonotone(boolean strict)
          Determine whether the LRS measures (not the x,y,z coordinates) in the Coordinate sequence of the geometry is Monotone.
 void measureOnLength(boolean keepBeginMeasure)
          Builds measures along the Geometry based on the length from the beginning (first coordinate) of the Geometry.
 

Field Detail

INCREASING

static final int INCREASING
Measures are increasing in the direction of the MGeometry

See Also:
Constant Field Values

CONSTANT

static final int CONSTANT
Measures are constant across the Geometry

See Also:
Constant Field Values

DECREASING

static final int DECREASING
Measures are decreasing in the direction of the MGeometry

See Also:
Constant Field Values

NON_MONOTONE

static final int NON_MONOTONE
Measures are not monotone along the Geometry

See Also:
Constant Field Values
Method Detail

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 sought
tolerance - 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

com.vividsolutions.jts.geom.Coordinate getCoordinateAtM(double m)
                                                        throws MGeometryException
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 measure
end - 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:

Returns:
true if the coordinates in the CoordinateSequence of the geometry are monotone.

asGeometry

com.vividsolutions.jts.geom.Geometry asGeometry()
Returns this MGeometry as a Geometry.

Modifying the returned Geometry will result in internal state changes.

Returns:
this object as a Geometry.