CoordinateSequence class abstract
// Coordinate subclass supporting XY ordinate. //
// This data object is suitable for use with coordinate sequences dimension 3, measures 1. // The {@link Coordinate#Z} field is visible, but intended to be ignored. // // @since 1.16 The internal representation of a list of coordinates inside a Geometry.
This allows Geometries to store their points using something other than the JTS {@link Coordinate} class. For example, a storage-efficient implementation might store coordinate sequences as an array of x's and an array of y's. Or a custom coordinate class might support extra attributes like M-values.
Implementing a custom coordinate storage structure requires implementing the {@link CoordinateSequence} and {@link CoordinateSequenceFactory} interfaces. To use the custom CoordinateSequence, create a new {@link GeometryFactory} parameterized by the CoordinateSequenceFactory The {@link GeometryFactory} can then be used to create new {@link Geometry}s. The new Geometries will use the custom CoordinateSequence implementation.
For an example, see the code for {@link ExtendedCoordinateExample}.
@see CoordinateArraySequenceFactory @see PackedCoordinateSequenceFactory @see ExtendedCoordinateExample
@version 1.7
- Implementers
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
-
clone(
) → Object - Returns a deep copy of this collection. Called by Geometry#clone.
-
copy(
) → CoordinateSequence - Returns a deep copy of this collection.
-
createCoordinate(
) → Coordinate - Creates a coordinate for use in this sequence.
-
expandEnvelope(
Envelope env) → Envelope - Expands the given {@link Envelope} to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values.
-
getCoordinate(
int i) → Coordinate - Returns (possibly a copy of) the i'th coordinate in this sequence. Whether or not the Coordinate returned is the actual underlying Coordinate or merely a copy depends on the implementation.
-
getCoordinateCopy(
int i) → Coordinate - Returns a copy of the i'th coordinate in this sequence. This method optimizes the situation where the caller is going to make a copy anyway - if the implementation has already created a new Coordinate object, no further copy is needed.
-
getCoordinateInto(
int index, Coordinate coord) → void - Copies the i'th coordinate in the sequence to the supplied {@link Coordinate}. Only the first two dimensions are copied.
-
getDimension(
) → int - Returns the dimension (number of ordinates in each coordinate) for this sequence.
-
getM(
int index) → double - Returns ordinate M of the specified coordinate if available.
-
getMeasures(
) → int - Returns the number of measures included in {@link #getDimension()} for each coordinate for this sequence.
-
getOrdinate(
int index, int ordinateIndex) → double - Returns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y.
-
getX(
int index) → double - Returns ordinate X (0) of the specified coordinate.
-
getY(
int index) → double - Returns ordinate Y (1) of the specified coordinate.
-
getZ(
int index) → double - Returns ordinate Z of the specified coordinate if available.
-
hasM(
) → bool - Checks {@link #getMeasures()} to determine if {@link #getM(int)} is supported.
-
hasZ(
) → bool - Checks {@link #getDimension()} and {@link #getMeasures()} to determine if {@link #getZ(int)} is supported.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setOrdinate(
int index, int ordinateIndex, double value) → void - Sets the value for a given ordinate of a coordinate in this sequence.
-
size(
) → int - Returns the number of coordinates in this sequence. @return the size of the sequence
-
toCoordinateArray(
) → List< Coordinate> - Returns (possibly copies of) the Coordinates in this collection. Whether or not the Coordinates returned are the actual underlying Coordinates or merely copies depends on the implementation. Note that if this implementation does not store its data as an array of Coordinates, this method will incur a performance penalty because the array needs to be built from scratch.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited