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 intcompareOriented(Coordinate[] pts1, boolean orientation1, Coordinate[] pts2, boolean orientation2) intCompares twoOrientedCoordinateArrays for their relative orderprivate static booleanorientation(Coordinate[] pts) Computes the canonical orientation for a coordinate array.
-
Field Details
-
pts
-
orientation
private boolean orientation
-
-
Constructor Details
-
OrientedCoordinateArray
Creates a newOrientedCoordinateArrayfor the givenCoordinatearray.- Parameters:
pts- the coordinates to orient
-
-
Method Details
-
orientation
Computes the canonical orientation for a coordinate array.- Parameters:
pts- the array to test- Returns:
trueif the points are oriented forwards orfalseinvalid input: '<'/code if the points are oriented in reverse
-
compareTo
Compares twoOrientedCoordinateArrays for their relative order- Specified by:
compareToin 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)
-