CoordinateXY class

Coordinate subclass supporting XY ordinates.

This data object is suitable for use with coordinate sequences with dimension = 2.

The {@link Coordinate#z} field is visible, but intended to be ignored.

@since 1.16

Inheritance

Constructors

CoordinateXY()
Default constructor
CoordinateXY.fromCoordinate(Coordinate coord)
Constructs a CoordinateXY instance with the x and y ordinates of the given Coordinate.
CoordinateXY.fromCoordinateXY(CoordinateXY coord)
Constructs a CoordinateXY instance with the x and y ordinates of the given CoordinateXY.
CoordinateXY.fromXY(double x, double y)
Constructs a CoordinateXY instance with the given ordinates.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
x double
The x-ordinate.
getter/setter pairinherited
y double
The y-ordinate.
getter/setter pairinherited
z double
The z-ordinate.
getter/setter pairinherited

Methods

clone() Object
inherited
compareTo(Coordinate other) int
Compares this {@link Coordinate} with the specified {@link Coordinate} for order. This method ignores the z value when making the comparison. Returns:
inherited
copy() CoordinateXY
Creates a copy of this CoordinateXY.
override
distance(Coordinate c) double
Computes the 2-dimensional Euclidean distance to another location. The Z-ordinate is ignored.
inherited
distance3D(Coordinate c) double
Computes the 3-dimensional Euclidean distance to another location.
inherited
equalInZ(Coordinate c, double tolerance) bool
Tests if another coordinate has the same value for Z, within a tolerance.
inherited
equals(Object other) bool
Returns true if other has the same values for the x and y ordinates. Since Coordinates are 2.5D, this routine ignores the z value when making the comparison.
inherited
equals2D(Coordinate other) bool
Returns whether the planar projections of the two Coordinates are equal.
inherited
equals2DWithTolerance(Coordinate c, double tolerance) bool
Tests if another Coordinate has the same values for the X and Y ordinates, within a specified tolerance value. The Z ordinate is ignored.
inherited
equals3D(Coordinate other) bool
Tests if another coordinate has the same values for the X, Y and Z ordinates.
inherited
getM() double
Retrieves the value of the measure, if present. If no measure value is present returns NaN.
inherited
getOrdinate(int ordinateIndex) double
Gets the ordinate value for the given index.
override
getX() double
Retrieves the value of the X ordinate.
inherited
getY() double
Retrieves the value of the Y ordinate.
inherited
getZ() double
The z-ordinate is not supported
override
isValid() bool
Tests if the coordinate has valid X and Y ordinate values. An ordinate value is valid iff it is finite.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setCoordinate(Coordinate other) → void
Sets this Coordinates (x,y,z) values to that of other.
override
setM(double m) → void
Sets the measure value, if supported.
inherited
setOrdinate(int ordinateIndex, double value) → void
Sets the ordinate for the given index to a given value.
override
setX(double x) → void
Sets the X ordinate value.
inherited
setY(double y) → void
Sets the Y ordinate value.
inherited
setZ(double z) → void
The z-ordinate is not supported
override
toString() String
Returns a String of the form (x,y,z) .
override

Operators

operator +(Coordinate other) Coordinate
Returns the (vector-) sum of this and other.
inherited
operator -(Coordinate other) Coordinate
inherited
operator ==(Object o) bool
The equality operator.
inherited

Constants

M → const int
CoordinateXY does not support M measures.
X → const int
Standard ordinate index value for X
Y → const int
Standard ordinate index value for Y
Z → const int
CoordinateXY does not support Z values.