Package org.locationtech.jts.geom
Class CoordinateXYM
- java.lang.Object
-
- org.locationtech.jts.geom.Coordinate
-
- org.locationtech.jts.geom.CoordinateXYM
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Coordinate>
public class CoordinateXYM extends Coordinate
Coordinate subclass supporting XYM ordinate.This data object is suitable for use with coordinate sequences dimension 3, measures 1.
- Since:
- 1.16
- See Also:
- Serialized Form
-
-
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 int
M
Standard ordinate index value for, where M is 3.static int
X
Standard ordinate index value for, where X is 0static int
Y
Standard ordinate index value for, where Y is 1static int
Z
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 CoordinateXYM()
Default constructorCoordinateXYM(double x, double y, double m)
CoordinateXYM(Coordinate coord)
CoordinateXYM(CoordinateXYM coord)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinateXYM
copy()
double
getM()
The m-measure, if available.double
getOrdinate(int ordinateIndex)
Gets the ordinate value for the given index.double
getZ()
The z-ordinate is not supportedvoid
setCoordinate(Coordinate other)
Sets thisCoordinate
s (x,y,z) values to that ofother
.void
setM(double m)
The m-measure, 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 supportedjava.lang.String
toString()
Returns aString
of the form (x,y,z) .
-
-
-
Field Detail
-
X
public static final int X
Standard ordinate index value for, where X is 0- See Also:
- Constant Field Values
-
Y
public static final int Y
Standard ordinate index value for, where Y is 1- See Also:
- Constant Field Values
-
Z
public static final int Z
CoordinateXYM does not support Z values.- See Also:
- Constant Field Values
-
M
public static final int M
Standard ordinate index value for, where M is 3.This constant assumes XYM coordinate sequence definition, please check this assumption using
#getDimension()
and#getMeasures()
before use.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CoordinateXYM
public CoordinateXYM()
Default constructor
-
CoordinateXYM
public CoordinateXYM(double x, double y, double m)
-
CoordinateXYM
public CoordinateXYM(Coordinate coord)
-
CoordinateXYM
public CoordinateXYM(CoordinateXYM coord)
-
-
Method Detail
-
copy
public CoordinateXYM copy()
- Overrides:
copy
in classCoordinate
-
getM
public double getM()
The m-measure, if available.- Overrides:
getM
in classCoordinate
-
setM
public void setM(double m)
Description copied from class:Coordinate
The m-measure, if supported.- Overrides:
setM
in classCoordinate
-
getZ
public double getZ()
The z-ordinate is not supported- Overrides:
getZ
in classCoordinate
-
setZ
public void setZ(double z)
The z-ordinate is not supported- Overrides:
setZ
in classCoordinate
-
setCoordinate
public void setCoordinate(Coordinate other)
Description copied from class:Coordinate
Sets thisCoordinate
s (x,y,z) values to that ofother
.- Overrides:
setCoordinate
in classCoordinate
- Parameters:
other
- theCoordinate
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 areCoordinate.X
,Coordinate.Y
, andCoordinate.Z
.- Overrides:
getOrdinate
in classCoordinate
- 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 areCoordinate.X
,Coordinate.Y
, andCoordinate.Z
.- Overrides:
setOrdinate
in classCoordinate
- Parameters:
ordinateIndex
- the ordinate indexvalue
- the value to set
-
toString
public java.lang.String toString()
Description copied from class:Coordinate
Returns aString
of the form (x,y,z) .- Overrides:
toString
in classCoordinate
- Returns:
- a
String
of the form (x,y,z)
-
-