Interface PackedLineString

All Superinterfaces:
Serializable, scala.Serializable

public interface PackedLineString extends scala.Serializable
A line string containing PackedGeoCoordinates.

This interface is optimized to avoid allocations when accessing vertex geometries.

  • Method Details

    • apply

      Selects an element by its index in the PackedLineString.

      Parameters:
      idx - The index to select
      Returns:
      The element of this PackedLineString at index idx, where 0 indicates the first element
      Throws:
      IndexOutOfBoundsException - if idx is not in the interval [0, length)
    • length

      int length()
      The length of the PackedLineString.

      Returns:
      The number of elements in this PackedLineString
    • toIndexedSeq

      scala.collection.IndexedSeq<PackedGeoCoordinate> toIndexedSeq()
      Converts this PackedLineString 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)