Class CoordinateXYZM

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

public class CoordinateXYZM extends Coordinate
Coordinate subclass supporting XYZM ordinates.

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

Since:
1.16
See Also:
  • Constructor Details

    • CoordinateXYZM

      public CoordinateXYZM()
      Default constructor
    • CoordinateXYZM

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

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

      public CoordinateXYZM(CoordinateXYZM coord)
      Constructs a CoordinateXYZM instance with the ordinates of the given CoordinateXYZM.
      Parameters:
      coord - the coordinate providing the ordinates
  • Method Details

    • copy

      public CoordinateXYZM copy()
      Creates a copy of this CoordinateXYZM.
      Overrides:
      copy in class Coordinate
      Returns:
      a copy of this CoordinateXYZM
    • 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
    • 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
    • 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
    • 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)