Class CoordinateXYM

java.lang.Object
org.locationtech.jts.geom.Coordinate
org.locationtech.jts.geom.CoordinateXYM
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Coordinate>

public class CoordinateXYM extends Coordinate
Coordinate subclass supporting XYM ordinates.

This data object is suitable for use with coordinate sequences with dimension = 3 and measures = 1.

The Coordinate.z field is visible, but intended to be ignored.

Since:
1.16
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.locationtech.jts.geom.Coordinate

    Coordinate.DimensionalComparator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Standard ordinate index value for M in XYM sequences.
    static final int
    Standard ordinate index value for X
    static final int
    Standard ordinate index value for Y
    static final int
    CoordinateXYM does not support Z values.

    Fields inherited from class org.locationtech.jts.geom.Coordinate

    NULL_ORDINATE, x, y, z
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
    CoordinateXYM(double x, double y, double m)
    Constructs a CoordinateXYM instance with the given ordinates and measure.
    Constructs a CoordinateXYM instance with the x and y ordinates of the given Coordinate.
    Constructs a CoordinateXY instance with the x and y ordinates of the given CoordinateXYM.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a copy of this CoordinateXYM.
    Create a new Coordinate of the same type as this Coordinate, but with no values.
    double
    The m-measure, if available.
    double
    getOrdinate(int ordinateIndex)
    Gets the ordinate value for the given index.
    double
    The z-ordinate is not supported
    void
    Sets this Coordinates (x,y,z) values to that of other.
    void
    setM(double m)
    Sets the measure value, if supported.
    void
    setOrdinate(int ordinateIndex, double value)
    Sets the ordinate for the given index to a given value.
    void
    setZ(double z)
    The z-ordinate is not supported
    Returns a String of the form (x,y,z) .

    Methods inherited from class org.locationtech.jts.geom.Coordinate

    clone, compareTo, distance, distance3D, equalInZ, equals, equals2D, equals2D, equals3D, getX, getY, hashCode, hashCode, isValid, setX, setY

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • CoordinateXYM

      public CoordinateXYM()
      Default constructor
    • CoordinateXYM

      public CoordinateXYM(double x, double y, double m)
      Constructs a CoordinateXYM instance with the given ordinates and measure.
      Parameters:
      x - the X ordinate
      y - the Y ordinate
      m - the M measure value
    • CoordinateXYM

      public CoordinateXYM(Coordinate coord)
      Constructs a CoordinateXYM instance with the x and y ordinates of the given Coordinate.
      Parameters:
      coord - the coordinate providing the ordinates
    • CoordinateXYM

      public CoordinateXYM(CoordinateXYM coord)
      Constructs a CoordinateXY instance with the x and y ordinates of the given CoordinateXYM.
      Parameters:
      coord - the coordinate providing the ordinates
  • Method Details

    • copy

      public CoordinateXYM copy()
      Creates a copy of this CoordinateXYM.
      Overrides:
      copy in class Coordinate
      Returns:
      a copy of this CoordinateXYM
    • create

      public Coordinate create()
      Create a new Coordinate of the same type as this Coordinate, but with no values.
      Overrides:
      create in class Coordinate
      Returns:
      a new Coordinate
    • getM

      public double getM()
      The m-measure, if available.
      Overrides:
      getM in class Coordinate
      Returns:
      the value of the measure, or NaN
    • setM

      public void setM(double m)
      Description copied from class: Coordinate
      Sets the measure value, if supported.
      Overrides:
      setM in class Coordinate
      Parameters:
      m - the value to set as M
    • getZ

      public double getZ()
      The z-ordinate is not supported
      Overrides:
      getZ in class Coordinate
      Returns:
      the value of the Z ordinate, or NaN
    • setZ

      public void setZ(double z)
      The z-ordinate is not supported
      Overrides:
      setZ in class Coordinate
      Parameters:
      z - the value to set as Z
    • setCoordinate

      public void setCoordinate(Coordinate other)
      Description copied from class: Coordinate
      Sets this Coordinates (x,y,z) values to that of other.
      Overrides:
      setCoordinate in class Coordinate
      Parameters:
      other - the Coordinate to copy
    • getOrdinate

      public double getOrdinate(int ordinateIndex)
      Description copied from class: Coordinate
      Gets the ordinate value for the given index. The base implementation supports values for the index are Coordinate.X, Coordinate.Y, and Coordinate.Z.
      Overrides:
      getOrdinate in class Coordinate
      Parameters:
      ordinateIndex - the ordinate index
      Returns:
      the value of the ordinate
    • setOrdinate

      public void setOrdinate(int ordinateIndex, double value)
      Description copied from class: Coordinate
      Sets the ordinate for the given index to a given value. The base implementation supported values for the index are Coordinate.X, Coordinate.Y, and Coordinate.Z.
      Overrides:
      setOrdinate in class Coordinate
      Parameters:
      ordinateIndex - the ordinate index
      value - the value to set
    • toString

      public String toString()
      Description copied from class: Coordinate
      Returns a String of the form (x,y,z) .
      Overrides:
      toString in class Coordinate
      Returns:
      a String of the form (x,y,z)