Class OrientedCoordinateArray

java.lang.Object
org.locationtech.jts.noding.OrientedCoordinateArray
All Implemented Interfaces:
Comparable

public class OrientedCoordinateArray extends Object implements Comparable
Allows comparing Coordinate arrays in an orientation-independent way.
Version:
1.7
  • Field Details

    • pts

      private Coordinate[] pts
    • orientation

      private boolean orientation
  • Constructor Details

  • Method Details

    • orientation

      private static boolean orientation(Coordinate[] pts)
      Computes the canonical orientation for a coordinate array.
      Parameters:
      pts - the array to test
      Returns:
      true if the points are oriented forwards or falseinvalid input: '<'/code if the points are oriented in reverse
    • compareTo

      public int compareTo(Object o1)
      Compares two OrientedCoordinateArrays for their relative order
      Specified by:
      compareTo in interface Comparable
      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)