Class PackedCoordinateSequenceFactory
java.lang.Object
org.apache.sis.internal.feature.jts.PackedCoordinateSequenceFactory
- All Implemented Interfaces:
Serializable
,org.locationtech.jts.geom.CoordinateSequenceFactory
final class PackedCoordinateSequenceFactory
extends Object
implements org.locationtech.jts.geom.CoordinateSequenceFactory, Serializable
A factory of JTS coordinate sequence storing coordinates in a single
float[]
or double[]
array.
This class serves the same purpose than PackedCoordinateSequenceFactory
but without caching the Coordinate[]
array.- Since:
- 1.2
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final boolean
Whether to use double-precision floating point numbers.private static final long
For cross-version compatibility. -
Constructor Summary
ConstructorsConstructorDescriptionPackedCoordinateSequenceFactory
(boolean doublePrecision) Creates a new factory. -
Method Summary
Modifier and TypeMethodDescriptionorg.locationtech.jts.geom.CoordinateSequence
create
(int size, int dimension) Creates a new coordinate sequence for the given number of dimensions.create
(int size, int dimension, int measures) Creates a new coordinate sequence for the given number of dimensions and measures.org.locationtech.jts.geom.CoordinateSequence
create
(org.locationtech.jts.geom.Coordinate[] coordinates) Creates a new sequence with the given coordinates.org.locationtech.jts.geom.CoordinateSequence
create
(org.locationtech.jts.geom.CoordinateSequence original) Creates a new sequence as a copy of the given sequence.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
doublePrecision
protected final boolean doublePrecisionWhether to use double-precision floating point numbers.
-
-
Constructor Details
-
PackedCoordinateSequenceFactory
PackedCoordinateSequenceFactory(boolean doublePrecision) Creates a new factory.- Parameters:
doublePrecision
- whether to use double-precision floating point numbers.
-
-
Method Details
-
create
public org.locationtech.jts.geom.CoordinateSequence create(org.locationtech.jts.geom.Coordinate[] coordinates) Creates a new sequence with the given coordinates. All values are copied. The number of dimensions of the sequence is the minimal number of dimensions found in all coordinates. We use the minimal number because requesting a inexistent dimension or measure inCoordinate
may cause an exception to be thrown.- Specified by:
create
in interfaceorg.locationtech.jts.geom.CoordinateSequenceFactory
- Parameters:
coordinates
- the coordinate values, ornull
for an empty sequence.- Returns:
- a newly created coordinate sequence with the given coordinate values.
-
create
public org.locationtech.jts.geom.CoordinateSequence create(org.locationtech.jts.geom.CoordinateSequence original) Creates a new sequence as a copy of the given sequence.- Specified by:
create
in interfaceorg.locationtech.jts.geom.CoordinateSequenceFactory
- Parameters:
original
- the sequence to copy, ornull
for an empty sequence.- Returns:
- a newly created coordinate sequence with the values of the given sequence.
-
create
public org.locationtech.jts.geom.CoordinateSequence create(int size, int dimension) Creates a new coordinate sequence for the given number of dimensions. -
create
Creates a new coordinate sequence for the given number of dimensions and measures.- Specified by:
create
in interfaceorg.locationtech.jts.geom.CoordinateSequenceFactory
- Parameters:
size
- number of coordinate tuples.dimension
- number of dimensions, including the number of measures.measures
- number of M coordinates.- Returns:
- a newly created coordinate sequence with all values initialized to zero.
-