Interface MGeometry

All Superinterfaces:
Cloneable, Serializable
All Known Implementing Classes:
MLineString, MultiMLineString

public interface MGeometry extends Cloneable, Serializable
Defines geometries that carry measures in their CoordinateSequence.
Author:
Karel Maesen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Measures are constant across the Geometry
    static final int
    Measures are decreasing in the direction of the MGeometry
    static final int
    Measures are increasing in the direction of the MGeometry
    static final int
    Measures are not monotone along the Geometry
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vividsolutions.jts.geom.Geometry
    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
    Returns the GeometryFactory of the MGeometry
    double
    getMatCoordinate(com.vividsolutions.jts.geom.Coordinate c, double tolerance)
    Returns the measure value at the Coordinate
    double
    Returns the maximum M-value of the MGeometry
    double
    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 Details

    • INCREASING

      static final int INCREASING
      Measures are increasing in the direction of the MGeometry
      See Also:
    • CONSTANT

      static final int CONSTANT
      Measures are constant across the Geometry
      See Also:
    • DECREASING

      static final int DECREASING
      Measures are decreasing in the direction of the MGeometry
      See Also:
    • NON_MONOTONE

      static final int NON_MONOTONE
      Measures 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 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:
      • [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 this MGeometry as a Geometry.

      Modifying the returned Geometry will result in internal state changes.

      Returns:
      this object as a Geometry.