GEOS  3.12.0dev
geos::geom::Coordinate Class Reference

Coordinate is the lightweight class used to store coordinates. More...

`#include <geos.h>`

## Public Types

typedef std::set< const Coordinate *, CoordinateLessThenConstSet
A set of const Coordinate pointers.

typedef std::vector< const Coordinate * > ConstVect
A vector of const Coordinate pointers.

typedef std::stack< const Coordinate * > ConstStack
A stack of const Coordinate pointers.

typedef std::vector< CoordinateVect
A vector of Coordinate objects (real object, not pointers)

## Public Member Functions

Coordinate (double xNew, double yNew, double zNew=DoubleNotANumber)

void setNull ()

bool isNull () const

bool isValid () const

bool equals2D (const Coordinate &other) const

bool equals2D (const Coordinate &other, double tolerance) const

bool equals (const Coordinate &other) const
2D only

int compareTo (const Coordinate &other) const
TODO: deprecate this, move logic to CoordinateLessThen instead.

bool equals3D (const Coordinate &other) const
3D comparison

std::string toString () const
Returns a string of the form (x,y,z) .

double distance (const Coordinate &p) const

double distanceSquared (const Coordinate &p) const

## Static Public Member Functions

static CoordinategetNull ()

double x
x-coordinate

double y
y-coordinate

double z
z-coordinate

## Friends

std::ostream & operator<< (std::ostream &os, const Coordinate &c)
Output function.

bool operator== (const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.

bool operator!= (const Coordinate &a, const Coordinate &b)
Inequality operator for Coordinate. 2D only.

## Detailed Description

Coordinate is the lightweight class used to store coordinates.

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

Coordinate objects are two-dimensional points, with an additional z-ordinate. JTS does not support any operations on the z-ordinate except the basic accessor functions.

Constructed coordinates will have a z-ordinate of DoubleNotANumber. The standard comparison functions will ignore the z-ordinate.

## ◆ distance()

 double geos::geom::Coordinate::distance ( const Coordinate & p ) const
inline

TODO: obsoleted this, can use PrecisionModel::makePrecise(Coordinate*) instead

The documentation for this class was generated from the following file: