Package org.locationtech.jts.noding
Class OrientedCoordinateArray
java.lang.Object
org.locationtech.jts.noding.OrientedCoordinateArray
- All Implemented Interfaces:
Comparable
Allows comparing
Coordinate
arrays
in an orientation-independent way.- Version:
- 1.7
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
compareOriented
(Coordinate[] pts1, boolean orientation1, Coordinate[] pts2, boolean orientation2) int
Compares twoOrientedCoordinateArray
s for their relative orderprivate static boolean
orientation
(Coordinate[] pts) Computes the canonical orientation for a coordinate array.
-
Field Details
-
pts
-
orientation
private boolean orientation
-
-
Constructor Details
-
OrientedCoordinateArray
Creates a newOrientedCoordinateArray
for the givenCoordinate
array.- Parameters:
pts
- the coordinates to orient
-
-
Method Details
-
orientation
Computes the canonical orientation for a coordinate array.- Parameters:
pts
- the array to test- Returns:
true
if the points are oriented forwards orfalseinvalid input: '<'/code if the points are oriented in reverse
-
compareTo
Compares twoOrientedCoordinateArray
s for their relative order- Specified by:
compareTo
in interfaceComparable
- Returns:
- -1 this one is smaller; 0 the two objects are equal; 1 this one is greater
-
compareOriented
private static int compareOriented(Coordinate[] pts1, boolean orientation1, Coordinate[] pts2, boolean orientation2)
-