Package org.locationtech.jts.geom
Class CoordinateXYZM
java.lang.Object
org.locationtech.jts.geom.Coordinate
org.locationtech.jts.geom.CoordinateXYZM
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.locationtech.jts.geom.Coordinate
Coordinate.DimensionalComparator
-
Field Summary
Fields inherited from class org.locationtech.jts.geom.Coordinate
M, NULL_ORDINATE, x, X, y, Y, z, Z
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCoordinateXYZM
(double x, double y, double z, double m) Constructs a CoordinateXYZM instance with the given ordinates and measure.CoordinateXYZM
(Coordinate coord) Constructs a CoordinateXYZM instance with the ordinates of the given Coordinate.CoordinateXYZM
(CoordinateXYZM coord) Constructs a CoordinateXYZM instance with the ordinates of the given CoordinateXYZM. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a copy of this CoordinateXYZM.create()
Create a new Coordinate of the same type as this Coordinate, but with no values.double
getM()
The m-measure, if available.double
getOrdinate
(int ordinateIndex) Gets the ordinate value for the given index.void
setCoordinate
(Coordinate other) Sets thisCoordinate
s (x,y,z) values to that ofother
.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.toString()
Returns aString
of the form (x,y,z) .
-
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 ordinatey
- the Y ordinatez
- the Z ordinatem
- the M measure value
-
CoordinateXYZM
Constructs a CoordinateXYZM instance with the ordinates of the given Coordinate.- Parameters:
coord
- the coordinate providing the ordinates
-
CoordinateXYZM
Constructs a CoordinateXYZM instance with the ordinates of the given CoordinateXYZM.- Parameters:
coord
- the coordinate providing the ordinates
-
-
Method Details
-
copy
Creates a copy of this CoordinateXYZM.- Overrides:
copy
in classCoordinate
- Returns:
- a copy of this CoordinateXYZM
-
create
Create a new Coordinate of the same type as this Coordinate, but with no values.- Overrides:
create
in classCoordinate
- Returns:
- a new Coordinate
-
getM
public double getM()The m-measure, if available.- Overrides:
getM
in classCoordinate
- 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 classCoordinate
- 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 areCoordinate.X
,Coordinate.Y
, andCoordinate.Z
.- Overrides:
getOrdinate
in classCoordinate
- Parameters:
ordinateIndex
- the ordinate index- Returns:
- the value of the ordinate
-
setCoordinate
Description copied from class:Coordinate
Sets thisCoordinate
s (x,y,z) values to that ofother
.- Overrides:
setCoordinate
in classCoordinate
- Parameters:
other
- theCoordinate
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 areCoordinate.X
,Coordinate.Y
, andCoordinate.Z
.- Overrides:
setOrdinate
in classCoordinate
- Parameters:
ordinateIndex
- the ordinate indexvalue
- the value to set
-
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)
-