GEOS  3.9.1dev
Static Public Member Functions | List of all members
geos::noding::SegmentPointComparator Class Reference

Implements a robust method of comparing the relative position of two points along the same segment. More...

#include <SegmentPointComparator.h>

Static Public Member Functions

static int compare (int octant, const geom::Coordinate &p0, const geom::Coordinate &p1)
 Compares two Coordinates for their relative position along a segment lying in the specified Octant. More...
 
static int relativeSign (double x0, double x1)
 
static int compareValue (int compareSign0, int compareSign1)
 

Detailed Description

Implements a robust method of comparing the relative position of two points along the same segment.

The coordinates are assumed to lie "near" the segment. This means that this algorithm will only return correct results if the input coordinates have the same precision and correspond to rounded values of exact coordinates lying on the segment.

Definition at line 40 of file SegmentPointComparator.h.

Member Function Documentation

static int geos::noding::SegmentPointComparator::compare ( int  octant,
const geom::Coordinate p0,
const geom::Coordinate p1 
)
inlinestatic

Compares two Coordinates for their relative position along a segment lying in the specified Octant.

Returns
-1 node0 occurs first
0 the two nodes are equal
1 node1 occurs first

Definition at line 53 of file SegmentPointComparator.h.

References geos::geom::Coordinate::equals2D(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

Here is the call graph for this function:

static int geos::noding::SegmentPointComparator::compareValue ( int  compareSign0,
int  compareSign1 
)
inlinestatic

Definition at line 100 of file SegmentPointComparator.h.

static int geos::noding::SegmentPointComparator::relativeSign ( double  x0,
double  x1 
)
inlinestatic

Definition at line 88 of file SegmentPointComparator.h.


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