public class CoordinateSequences extends Object
CoordinateSequence
sConstructor and Description |
---|
CoordinateSequences() |
Modifier and Type | Method and Description |
---|---|
static void |
copy(CoordinateSequence src,
int srcPos,
CoordinateSequence dest,
int destPos,
int length)
Copies a section of a
CoordinateSequence to another CoordinateSequence . |
static void |
copyCoord(CoordinateSequence src,
int srcPos,
CoordinateSequence dest,
int destPos)
Copies a coordinate of a
CoordinateSequence to another CoordinateSequence . |
static CoordinateSequence |
ensureValidRing(CoordinateSequenceFactory fact,
CoordinateSequence seq)
Ensures that a CoordinateSequence forms a valid ring,
returning a new closed sequence of the correct length if required.
|
static CoordinateSequence |
extend(CoordinateSequenceFactory fact,
CoordinateSequence seq,
int size) |
static boolean |
isEqual(CoordinateSequence cs1,
CoordinateSequence cs2)
Tests whether two
CoordinateSequence s are equal. |
static boolean |
isRing(CoordinateSequence seq)
Tests whether a
CoordinateSequence forms a valid LinearRing ,
by checking the sequence length and closure
(whether the first and last points are identical in 2D). |
static void |
reverse(CoordinateSequence seq)
Reverses the coordinates in a sequence in-place.
|
static void |
swap(CoordinateSequence seq,
int i,
int j)
Swaps two coordinates in a sequence.
|
static String |
toString(CoordinateSequence cs)
Creates a string representation of a
CoordinateSequence . |
public static void reverse(CoordinateSequence seq)
public static void swap(CoordinateSequence seq, int i, int j)
seq
- the sequence to modifyi
- the index of a coordinate to swapj
- the index of a coordinate to swappublic static void copy(CoordinateSequence src, int srcPos, CoordinateSequence dest, int destPos, int length)
CoordinateSequence
to another CoordinateSequence
.
The sequences may have different dimensions;
in this case only the common dimensions are copied.src
- the sequence to copy fromsrcPos
- the position in the source sequence to start copying atdest
- the sequence to copy todestPos
- the position in the destination sequence to copy tolength
- the number of coordinates to copypublic static void copyCoord(CoordinateSequence src, int srcPos, CoordinateSequence dest, int destPos)
CoordinateSequence
to another CoordinateSequence
.
The sequences may have different dimensions;
in this case only the common dimensions are copied.src
- the sequence to copy fromsrcPos
- the source coordinate to copydest
- the sequence to copy todestPos
- the destination coordinate to copy topublic static boolean isRing(CoordinateSequence seq)
CoordinateSequence
forms a valid LinearRing
,
by checking the sequence length and closure
(whether the first and last points are identical in 2D).
Self-intersection is not checked.seq
- the sequence to testLinearRing
public static CoordinateSequence ensureValidRing(CoordinateSequenceFactory fact, CoordinateSequence seq)
fact
- the CoordinateSequenceFactory to use to create the new sequenceseq
- the sequence to testpublic static CoordinateSequence extend(CoordinateSequenceFactory fact, CoordinateSequence seq, int size)
public static boolean isEqual(CoordinateSequence cs1, CoordinateSequence cs2)
CoordinateSequence
s are equal.
To be equal, the sequences must be the same length.
They do not need to be of the same dimension,
but the ordinate values for the smallest dimension of the two
must be equal.
Two NaN
ordinates values are considered to be equal.cs1
- a CoordinateSequencecs2
- a CoordinateSequencepublic static String toString(CoordinateSequence cs)
CoordinateSequence
.
The format is:
( ord0,ord1.. ord0,ord1,... ... )
cs
- the sequence to outputCopyright © 2016. All rights reserved.