CoordinateArrays class
Useful utility functions for handling Coordinate arrays
@version 1.7
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
bidirectionalComparator
↔ Comparator<
List< Coordinate> > -
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.
getter/setter pair
-
coordArrayType
→ List<
Coordinate> -
final
-
forwardComparator
↔ Comparator<
List< Coordinate> > -
A {@link Comparator} for {@link Coordinate} arrays
in the forward direction of their coordinates,
using lexicographic ordering.
getter/setter pair
Static Methods
-
atLeastNCoordinatesOrNothing(
int n, List< Coordinate> c) → List<Coordinate> - Returns either the given coordinate array if its length is greater than the given amount, or an empty coordinate array.
-
compare(
List< Coordinate> pts1, List<Coordinate> pts2) → int - Compares two {@link Coordinate} arrays in the forward direction of their coordinates, using lexicographic ordering.
-
copyDeep(
List< Coordinate> coordinates) → List<Coordinate> - Creates a deep copy of the argument {@link Coordinate} array.
-
copyDeepWithLength(
List< Coordinate> src, int srcStart, List<Coordinate> dest, int destStart, int length) → void - 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.
-
dimension(
List< Coordinate> ? pts) → int - Determine dimension based on subclass of {@link Coordinate}.
-
envelope(
List< Coordinate> coordinates) → Envelope - Computes the envelope of the coordinates.
-
equals(
List< Coordinate> ? coord1, List<Coordinate> ? coord2) → bool - Returns true if the two arrays are identical, both null, or pointwise equal (as compared using Coordinate#equals) @see Coordinate#equals(Object)
-
equalsWithComparator(
List< Coordinate> ? coord1, List<Coordinate> ? coord2, Comparator coordinateComparator) → bool - Returns true if the two arrays are identical, both null, or pointwise equal, using a user-defined {@link Comparator} for {@link Coordinate} s
-
extract(
List< Coordinate> pts, int start, int end) → List<Coordinate> -
Extracts a subsequence of the input {@link Coordinate} array
from indices
start
toend
(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. -
hasRepeatedOrInvalidPoints(
List< Coordinate> coord) → bool - Tests whether an array has any repeated or invalid coordinates.
-
increasingDirection(
List< Coordinate> pts) → int - 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.
-
indexOf(
Coordinate coordinate, List< Coordinate> coordinates) → int -
Returns the index of
coordinate
incoordinates
. The first position is 0; the second, 1; etc. -
intersection(
List< Coordinate> coordinates, Envelope env) → List<Coordinate> - Extracts the coordinates which intersect an {@link Envelope}.
-
isEqualReversed(
List< Coordinate> pts1, List<Coordinate> pts2) → dynamic - Determines whether two {@link Coordinate} arrays of equal length are equal in opposite directions.
-
isRing(
List< Coordinate> pts) → dynamic - Tests whether an array of {@link Coordinate}s forms a ring, by checking length and closure. Self-intersection is not checked.
-
measures(
List< Coordinate> ? pts) → int - Determine number of measures based on subclass of {@link Coordinate}.
-
minCoordinate(
List< Coordinate> coordinates) → Coordinate - Returns the minimum coordinate, using the usual lexicographic comparison.
-
ptNotInList(
List< Coordinate> testPts, List<Coordinate> pts) → Coordinate? -
Finds a point in a list of points which is not contained in another list of points
@param testPts the {@link Coordinate}s to test
@param pts an array of {@link Coordinate}s to test the input points against
@return a {@link Coordinate} from
testPts
which is not inpts
, ' ornull
-
removeNull(
List< Coordinate?> coord) → List<Coordinate> - Collapses a coordinate array to remove all null elements.
-
removeRepeatedOrInvalidPoints(
List< Coordinate> coord) → List<Coordinate> - If the coordinate array argument has repeated or invalid points, constructs a new array containing no repeated points. Otherwise, returns the argument.
-
removeRepeatedPoints(
List< Coordinate> coord) → List<Coordinate> - If the coordinate array argument has repeated points, constructs a new array containing no repeated points. Otherwise, returns the argument. @see #hasRepeatedPoints(List
-
reverse(
List< Coordinate> coord) → void - Reverses the coordinates in an array in-place.
-
scroll(
List< Coordinate> coordinates, Coordinate firstCoordinate) → void -
Shifts the positions of the coordinates until
firstCoordinate
is first.