Package org.locationtech.jts.geom
Class CoordinateXY
- java.lang.Object
-
- org.locationtech.jts.geom.Coordinate
-
- org.locationtech.jts.geom.CoordinateXY
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<Coordinate>
public class CoordinateXY extends Coordinate
Coordinate subclass supporting XY ordinate.This data object is suitable for use with coordinate sequences dimension 3, measures 1. The
Coordinate.Zfield is visible, but intended to be ignored.- 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 intMCoordinateXY does not support M measures.static intXStandard ordinate index value for, where X is 0static intYStandard ordinate index value for, where Y is 1static intZCoordinateXY does not support Z values.-
Fields inherited from class org.locationtech.jts.geom.Coordinate
NULL_ORDINATE, x, y, z
-
-
Constructor Summary
Constructors Constructor Description CoordinateXY()Default constructorCoordinateXY(double x, double y)CoordinateXY(Coordinate coord)CoordinateXY(CoordinateXY coord)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoordinateXYcopy()doublegetOrdinate(int ordinateIndex)Gets the ordinate value for the given index.doublegetZ()The z-ordinate is not supportedvoidsetCoordinate(Coordinate other)Sets thisCoordinates (x,y,z) values to that ofother.voidsetOrdinate(int ordinateIndex, double value)Sets the ordinate for the given index to a given value.voidsetZ(double z)The z-ordinate is not supportedjava.lang.StringtoString()Returns aStringof 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
CoordinateXY does not support Z values.- See Also:
- Constant Field Values
-
M
public static final int M
CoordinateXY does not support M measures.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CoordinateXY
public CoordinateXY()
Default constructor
-
CoordinateXY
public CoordinateXY(double x, double y)
-
CoordinateXY
public CoordinateXY(Coordinate coord)
-
CoordinateXY
public CoordinateXY(CoordinateXY coord)
-
-
Method Detail
-
copy
public CoordinateXY copy()
- Overrides:
copyin classCoordinate
-
getZ
public double getZ()
The z-ordinate is not supported- Overrides:
getZin classCoordinate
-
setZ
public void setZ(double z)
The z-ordinate is not supported- Overrides:
setZin classCoordinate
-
setCoordinate
public void setCoordinate(Coordinate other)
Description copied from class:CoordinateSets thisCoordinates (x,y,z) values to that ofother.- Overrides:
setCoordinatein classCoordinate- Parameters:
other- theCoordinateto copy
-
getOrdinate
public double getOrdinate(int ordinateIndex)
Description copied from class:CoordinateGets the ordinate value for the given index. The base implementation supports values for the index areCoordinate.X,Coordinate.Y, andCoordinate.Z.- Overrides:
getOrdinatein classCoordinate- Parameters:
ordinateIndex- the ordinate index- Returns:
- the value of the ordinate
-
setOrdinate
public void setOrdinate(int ordinateIndex, double value)Description copied from class:CoordinateSets 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:
setOrdinatein classCoordinate- Parameters:
ordinateIndex- the ordinate indexvalue- the value to set
-
toString
public java.lang.String toString()
Description copied from class:CoordinateReturns aStringof the form (x,y,z) .- Overrides:
toStringin classCoordinate- Returns:
- a
Stringof the form (x,y,z)
-
-