Interface PackedLineString
- All Superinterfaces:
Serializable
A line string containing
PackedGeoCoordinates.
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.intlength()The length of thePackedLineString.scala.collection.immutable.IndexedSeq<PackedGeoCoordinate>Converts thisPackedLineStringto 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
PackedLineStringat indexidx, where0indicates the first element - Throws:
IndexOutOfBoundsException- ifidxis not in the interval [0, length)
-
length
int length()The length of thePackedLineString.- Returns:
- The number of elements in this
PackedLineString
-
toIndexedSeq
scala.collection.immutable.IndexedSeq<PackedGeoCoordinate> toIndexedSeq()Converts thisPackedLineStringto 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)
-