public class OrientedCoordinateArray extends Object implements Comparable<OrientedCoordinateArray>
Coordinates arrays
in an orientation-independent way.| Constructor and Description |
|---|
OrientedCoordinateArray(LineString points)
Creates a new
OrientedCoordinateArray
for the given Coordinates array. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(OrientedCoordinateArray oca)
Compares two
OrientedCoordinateArrays for their relative order |
boolean |
getOrientation() |
LineString |
getPoints() |
static int |
increasingDirection(LineString points)
Determines which orientation of the
Coordinates array
is (overall) increasing. |
public OrientedCoordinateArray(LineString points)
OrientedCoordinateArray
for the given Coordinates array.points - the coordinates to orientpublic static int increasingDirection(LineString points)
Coordinates array
is (overall) increasing.
In other words, determines which end of the array is "smaller"
(using the standard ordering on Coordinates).
Returns an integer indicating the increasing direction.
If the sequence is a palindrome, it is defined to be
oriented in a positive direction.points - the array of Point to test1 if the array is smaller at the start
or is a palindrome,
-1 if smaller at the endpublic int compareTo(OrientedCoordinateArray oca)
OrientedCoordinateArrays for their relative ordercompareTo in interface Comparable<OrientedCoordinateArray>public boolean getOrientation()
public LineString getPoints()
Copyright © 2015 Revolution Systems Inc.. All rights reserved.