GEOS  3.8.0dev
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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
*, CoordinateLessThen
ConstSet
 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

void setNull ()
 
bool isNull () const
 
 Coordinate (double xNew=0.0, double yNew=0.0, double zNew=DoubleNotANumber)
 
bool equals2D (const Coordinate &other) 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
 
int hashCode () const
 

Static Public Member Functions

static CoordinategetNull ()
 
static int hashCode (double d)
 

Public Attributes

double x
 x-coordinate
 
double y
 y-coordinate
 
double z
 z-coordinate
 

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.

Member Function Documentation

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

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

static int geos::geom::Coordinate::hashCode ( double  d)
static

Returns a hash code for a double value, using the algorithm from Joshua Bloch's book Effective Java


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