GEOS  3.9.1dev
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Attributes | List of all members
geos::geom::Coordinate Class Reference

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

#include <geos.h>

Collaboration diagram for geos::geom::Coordinate:
[legend]

Classes

struct  HashCode
 

Public Types

typedef std::set< const Coordinate *, CoordinateLessThenConstSet
 A set of const Coordinate pointers. More...
 
typedef std::vector< const Coordinate * > ConstVect
 A vector of const Coordinate pointers. More...
 
typedef std::stack< const Coordinate * > ConstStack
 A stack of const Coordinate pointers. More...
 
typedef std::vector< CoordinateVect
 A vector of Coordinate objects (real object, not pointers) More...
 

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 More...
 
int compareTo (const Coordinate &other) const
 TODO: deprecate this, move logic to CoordinateLessThen instead. More...
 
bool equals3D (const Coordinate &other) const
 3D comparison More...
 
std::string toString () const
 Returns a string of the form (x,y,z) . More...
 
double distance (const Coordinate &p) const
 
double distanceSquared (const Coordinate &p) const
 

Static Public Member Functions

static CoordinategetNull ()
 

Public Attributes

double x
 x-coordinate More...
 
double y
 y-coordinate More...
 
double z
 z-coordinate More...
 

Static Private Attributes

static Coordinate _nullCoord
 

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.

Definition at line 60 of file Coordinate.h.

Member Typedef Documentation

A set of const Coordinate pointers.

Definition at line 68 of file Coordinate.h.

typedef std::stack<const Coordinate*> geos::geom::Coordinate::ConstStack

A stack of const Coordinate pointers.

Definition at line 74 of file Coordinate.h.

typedef std::vector<const Coordinate*> geos::geom::Coordinate::ConstVect

A vector of const Coordinate pointers.

Definition at line 71 of file Coordinate.h.

A vector of Coordinate objects (real object, not pointers)

Definition at line 77 of file Coordinate.h.

Constructor & Destructor Documentation

geos::geom::Coordinate::Coordinate ( double  xNew = 0.0,
double  yNew = 0.0,
double  zNew = DoubleNotANumber 
)

Member Function Documentation

int geos::geom::Coordinate::compareTo ( const Coordinate other) const

TODO: deprecate this, move logic to CoordinateLessThen instead.

Referenced by geos::operation::overlayng::Edge::compareTo().

Here is the caller graph for this function:

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

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

Referenced by geos::triangulate::quadedge::Vertex::equals(), and geos::operation::buffer::OffsetSegmentString::isRedundant().

Here is the caller graph for this function:

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

Referenced by geos::algorithm::CentralEndpointIntersector::findNearestPoint(), geos::algorithm::distance::PointPairDistance::initialize(), geos::algorithm::distance::PointPairDistance::setMaximum(), and geos::algorithm::distance::PointPairDistance::setMinimum().

Here is the caller graph for this function:

bool geos::geom::Coordinate::equals ( const Coordinate other) const

2D only

Referenced by geos::operation::buffer::OffsetSegmentString::closeRing().

Here is the caller graph for this function:

bool geos::geom::Coordinate::equals2D ( const Coordinate other) const

Referenced by geos::noding::NodedSegmentString::addIntersectionNode(), geos::noding::SegmentPointComparator::compare(), geos::geom::CoordinateList::insert(), and geos::geomgraph::Node::testInvariant().

Here is the caller graph for this function:

bool geos::geom::Coordinate::equals3D ( const Coordinate other) const

3D comparison

static Coordinate& geos::geom::Coordinate::getNull ( )
static

Referenced by geos::algorithm::CentralEndpointIntersector::findNearestPoint().

Here is the caller graph for this function:

bool geos::geom::Coordinate::isNull ( ) const
void geos::geom::Coordinate::setNull ( )

Referenced by geos::algorithm::MinimumBoundingCircle::MinimumBoundingCircle().

Here is the caller graph for this function:

std::string geos::geom::Coordinate::toString ( ) const

Returns a string of the form (x,y,z) .

Member Data Documentation

Coordinate geos::geom::Coordinate::_nullCoord
staticprivate

Definition at line 64 of file Coordinate.h.

double geos::geom::Coordinate::x
double geos::geom::Coordinate::y
double geos::geom::Coordinate::z

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