Package org.locationtech.jts.noding
Class SegmentPointComparator
java.lang.Object
org.locationtech.jts.noding.SegmentPointComparator
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.
- Version:
- 1.7
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
compare
(int octant, Coordinate p0, Coordinate p1) Compares twoCoordinate
s for their relative position along a segment lying in the specifiedOctant
.static int
relativeSign
(double x0, double x1)
-
Constructor Details
-
SegmentPointComparator
public SegmentPointComparator()
-
-
Method Details
-
compare
Compares twoCoordinate
s for their relative position along a segment lying in the specifiedOctant
.- Returns:
- -1 node0 occurs first; 0 the two nodes are equal; 1 node1 occurs first
-
relativeSign
public static int relativeSign(double x0, double x1)
-