Coordinate

@SerialVersionUID(6683108902428366910L) object Coordinate

A lightweight class used to store coordinates on the 2-dimensional Cartesian plane.

It is distinct from {link Point}, which is a subclass of {link Geometry}. Unlike objects of type {link Point} (which contain additional information such as an envelope, a precision model, and spatial reference system information), a <code>Coordinate</code> only contains ordinate values and accessor methods.

<code>Coordinate</code>s are two-dimensional points, with an additional Z-ordinate. If an Z-ordinate value is not specified or not defined, constructed coordinates have a Z-ordinate of <code>NaN</code> (which is also the value of <code>NULL_ORDINATE</code>). The standard comparison functions ignore the Z-ordinate. Apart from the basic accessor functions, JTS supports only specific operations involving the Z-ordinate.

Implementations may optionally support Z-ordinate and M-measure values as appropriate for a {link CoordinateSequence}. Use of {link #getZ()} and {link #getM()} accessors, or {link #getOrdinate(int)} are recommended.

Version

1.16

Companion
class
class Object
trait Matchable
class Any

Type members

Classlikes

Compares two {link Coordinate}s, allowing for either a 2-dimensional or 3-dimensional comparison, and handling NaN values correctly.

Compares two {link Coordinate}s, allowing for either a 2-dimensional or 3-dimensional comparison, and handling NaN values correctly.

Companion
class
class DimensionalComparator(val dimensionsToTest: Int) extends Comparator[Coordinate]
Companion
object

Value members

Concrete methods

def hashCode(x: Double): Int

Computes a hash code for a double value, using the algorithm from Joshua Bloch's book <i>Effective Java"</i>

Computes a hash code for a double value, using the algorithm from Joshua Bloch's book <i>Effective Java"</i>

Value Params
x

the value to compute for return a hashcode for x

Concrete fields

val M: Int

Standard ordinate index value for, where M is 3.

Standard ordinate index value for, where M is 3.

This constant assumes XYZM coordinate sequence definition, please check this assumption using {link #getDimension()} and {link #getMeasures()} before use.

val NULL_ORDINATE: Double

The value used to indicate a null or missing ordinate value. In particular, used for the value of ordinates for dimensions greater than the defined dimension of a coordinate.

The value used to indicate a null or missing ordinate value. In particular, used for the value of ordinates for dimensions greater than the defined dimension of a coordinate.

val X: Int

Standard ordinate index value for, where X is 0

Standard ordinate index value for, where X is 0

val Y: Int

Standard ordinate index value for, where Y is 1

Standard ordinate index value for, where Y is 1

val Z: Int

Standard ordinate index value for, where Z is 2.

Standard ordinate index value for, where Z is 2.

This constant assumes XYZM coordinate sequence definition, please check this assumption using {link #getDimension()} and {link #getMeasures()} before use.