Interface PackedLineString
- All Superinterfaces:
Serializable
,scala.Serializable
public interface PackedLineString
extends scala.Serializable
A line string containing
PackedGeoCoordinate
s.
This interface is optimized to avoid allocations when accessing vertex geometries.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionapply
(int idx) Selects an element by its index in thePackedLineString
.The sum of the length of each segment geometry chunk and the lengths of all previous chunks in a segment's geometry, in meters.int
length()
The length of thePackedLineString
.scala.collection.IndexedSeq<PackedGeoCoordinate>
Converts thisPackedLineString
to an indexed sequence.
-
Method Details
-
apply
Selects an element by its index in thePackedLineString
.- Parameters:
idx
- The index to select- Returns:
- The element of this
PackedLineString
at indexidx
, where0
indicates the first element - Throws:
IndexOutOfBoundsException
- ifidx
is not in the interval [0, length)
-
length
int length()The length of thePackedLineString
.- Returns:
- The number of elements in this
PackedLineString
-
toIndexedSeq
scala.collection.IndexedSeq<PackedGeoCoordinate> toIndexedSeq()Converts thisPackedLineString
to an indexed sequence.- Returns:
- An indexed sequence containing all elements of this
PackedLineString
-
cumulativeChunkLengths
StraightLineLengthSeq cumulativeChunkLengths()The sum of the length of each segment geometry chunk and the lengths of all previous chunks in a segment's geometry, in meters.For example, consider a line string with three points (two chunks). Assuming the distance between points 0 and 1 is 32 m and the distance between points 1 and 2 is 64 m. Then, the cumulative chunk lengths of this line string would be LengthSeq(32.0, 96.0)
-