CoordinateArrays
Useful utility functions for handling Coordinate arrays
- Version
1.7
Type members
Classlikes
A {link Comparator} for {link Coordinate} arrays modulo their directionality. E.g. if two coordinate arrays are identical but reversed they will compare as equal under this ordering. If the arrays are not equal, the ordering returned is the ordering in the forward direction.
A {link Comparator} for {link Coordinate} arrays modulo their directionality. E.g. if two coordinate arrays are identical but reversed they will compare as equal under this ordering. If the arrays are not equal, the ordering returned is the ordering in the forward direction.
Value members
Concrete methods
Returns either the given coordinate array if its length is greater than the given amount, or an empty coordinate array.
Returns either the given coordinate array if its length is greater than the given amount, or an empty coordinate array.
Compares two {link Coordinate} arrays in the forward direction of their coordinates, using lexicographic ordering.
Compares two {link Coordinate} arrays in the forward direction of their coordinates, using lexicographic ordering.
- Value Params
- pts2
return an integer indicating the order
Creates a deep copy of the argument {link Coordinate} array.
Creates a deep copy of the argument {link Coordinate} array.
- Value Params
- coordinates
an array of Coordinates return a deep copy of the input
Creates a deep copy of a given section of a source {link Coordinate} array into a destination Coordinate array. The destination array must be an appropriate size to receive the copied coordinates.
Creates a deep copy of a given section of a source {link Coordinate} array into a destination Coordinate array. The destination array must be an appropriate size to receive the copied coordinates.
- Value Params
- dest
the
- destStart
the destination index to start copying to
- length
the number of items to copy
- src
an array of Coordinates
- srcStart
the index to start copying from
Determine dimension based on subclass of {link Coordinate}.
Determine dimension based on subclass of {link Coordinate}.
- Value Params
- pts
supplied coordinates return number of ordinates recorded
Computes the envelope of the coordinates.
Computes the envelope of the coordinates.
- Value Params
- coordinates
the coordinates to scan return the envelope of the coordinates
Returns true if the two arrays are identical, both null, or pointwise equal (as compared using Coordinate#equals)
Returns true if the two arrays are identical, both null, or pointwise equal (as compared using Coordinate#equals)
- See also
Coordinate#equals(Object)
Returns true if the two arrays are identical, both null, or pointwise equal, using a user-defined {link Comparator} for {link Coordinate} s
Returns true if the two arrays are identical, both null, or pointwise equal, using a user-defined {link Comparator} for {link Coordinate} s
- Value Params
- coord1
an array of Coordinates
- coord2
an array of Coordinates
- coordinateComparator
a Comparator for Coordinates
Extracts a subsequence of the input {link Coordinate} array from indices <code>start</code> to <code>end</code> (inclusive). The input indices are clamped to the array size; If the end index is less than the start index, the extracted array will be empty.
Extracts a subsequence of the input {link Coordinate} array from indices <code>start</code> to <code>end</code> (inclusive). The input indices are clamped to the array size; If the end index is less than the start index, the extracted array will be empty.
- Value Params
- end
the index of the end of the subsequence to extract return a subsequence of the input array
- pts
the input array
- start
the index of the start of the subsequence to extract
Returns whether #equals returns true for any two consecutive Coordinates in the given array.
Returns whether #equals returns true for any two consecutive Coordinates in the given array.
Determines which orientation of the {link Coordinate} array is (overall) increasing. In other words, determines which end of the array is "smaller" (using the standard ordering on {link Coordinate}). Returns an integer indicating the increasing direction. If the sequence is a palindrome, it is defined to be oriented in a positive direction.
Determines which orientation of the {link Coordinate} array is (overall) increasing. In other words, determines which end of the array is "smaller" (using the standard ordering on {link Coordinate}). Returns an integer indicating the increasing direction. If the sequence is a palindrome, it is defined to be oriented in a positive direction.
- Value Params
- pts
the array of Coordinates to test return <code>1</code> if the array is smaller at the start or is a palindrome, <code>-1</code> if smaller at the end
Returns the index of <code>coordinate</code> in <code>coordinates</code>. The first position is 0; the second, 1; etc.
Returns the index of <code>coordinate</code> in <code>coordinates</code>. The first position is 0; the second, 1; etc.
- Value Params
- coordinate
the <code>Coordinate</code> to search for
- coordinates
the array to search return the position of <code>coordinate</code>, or -1 if it is not found
Extracts the coordinates which intersect an {link Envelope}
Extracts the coordinates which intersect an {link Envelope}
- Value Params
- coordinates
the coordinates to scan
- env
the envelope to intersect with return an array of the coordinates which intersect the envelope
Tests whether an array of {link Coordinate}s forms a ring, by checking length and closure. Self-intersection is not checked.
Tests whether an array of {link Coordinate}s forms a ring, by checking length and closure. Self-intersection is not checked.
- Value Params
- pts
an array of Coordinates return true if the coordinate form a ring.
Determine number of measures based on subclass of {link Coordinate}.
Determine number of measures based on subclass of {link Coordinate}.
- Value Params
- pts
supplied coordinates return number of measures recorded
Returns the minimum coordinate, using the usual lexicographic comparison.
Returns the minimum coordinate, using the usual lexicographic comparison.
- Value Params
- coordinates
the array to search return the minimum coordinate in the array, found using <code>compareTo</code>
- See also
Coordinate#compareTo(Object)
Finds a point in a list of points which is not contained in another list of points
Finds a point in a list of points which is not contained in another list of points
- Value Params
- pts
an array of { @link Coordinate}s to test the input points against return a { @link Coordinate} from <code>testPts</code> which is not in <code>pts</code>, ' or <code>null</code>
- testPts
the { @link Coordinate}s to test
Collapses a coordinate array to remove all null elements.
Collapses a coordinate array to remove all null elements.
- Value Params
- coord
the coordinate array to collapse return an array containing only non-null elements
If the coordinate array argument has repeated points, constructs a new array containing no repeated points. Otherwise, returns the argument.
If the coordinate array argument has repeated points, constructs a new array containing no repeated points. Otherwise, returns the argument.
- See also
#hasRepeatedPoints(Coordinate[])
Shifts the positions of the coordinates until <code>firstCoordinate</code> is first.
Shifts the positions of the coordinates until <code>firstCoordinate</code> is first.
- Value Params
- coordinates
the array to rearrange
- firstCoordinate
the coordinate to make first