Package org.locationtech.jtsexample.geom
Class ExtendedCoordinate
- java.lang.Object
-
- org.locationtech.jts.geom.Coordinate
-
- org.locationtech.jtsexample.geom.ExtendedCoordinate
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Coordinate>
public class ExtendedCoordinate extends Coordinate
- Version:
- 1.7
- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description ExtendedCoordinate()
Default constructorExtendedCoordinate(double x, double y, double z, double m)
ExtendedCoordinate(Coordinate coord)
ExtendedCoordinate(ExtendedCoordinate coord)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtendedCoordinate
copy()
Creates a copy of this Coordinate.double
getM()
Retrieves the value of the measure, if present.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.String
toString()
Returns aString
of the form (x,y,z) .
-
-
-
Constructor Detail
-
ExtendedCoordinate
public ExtendedCoordinate()
Default constructor
-
ExtendedCoordinate
public ExtendedCoordinate(double x, double y, double z, double m)
-
ExtendedCoordinate
public ExtendedCoordinate(Coordinate coord)
-
ExtendedCoordinate
public ExtendedCoordinate(ExtendedCoordinate coord)
-
-
Method Detail
-
copy
public ExtendedCoordinate copy()
Description copied from class:Coordinate
Creates a copy of this Coordinate.- Overrides:
copy
in classCoordinate
- Returns:
- a copy of this coordinate.
-
getM
public double getM()
Description copied from class:Coordinate
Retrieves the value of the measure, if present. If no measure value is present returns NaN.- 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
-
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
-
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
-
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
-
toString
public 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)
-
-