Itinerary

@Serializable(with = ItinerarySerializer::class)
data class Itinerary(val origin: Coordinate, val destination: Coordinate, val distance: Double, val duration: Double, val transitMode: TravelMode, val legs: List<Leg>) : CompactStringConvertible

An itinerary between an origin and a destination, composed of one or more Legs.

Constructors

Link copied to clipboard
constructor(origin: Coordinate, destination: Coordinate, distance: Double, duration: Double, transitMode: TravelMode, legs: List<Leg>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The final coordinate of the itinerary.

Link copied to clipboard

The total distance of the itinerary, in meters.

Link copied to clipboard

The total estimated duration of the itinerary, in seconds.

Link copied to clipboard
val legs: List<Leg>

The legs that compose the itinerary.

Link copied to clipboard

All coordinates of every leg, flattened into a single array.

Link copied to clipboard

All segments of every leg, computed by slicing the itinerary coordinates between consecutive steps.

Link copied to clipboard

All steps of every leg, flattened into a single array.

Link copied to clipboard

The starting coordinate of the itinerary.

Link copied to clipboard

The travel mode used to compute the itinerary.

Functions

Link copied to clipboard

Returns the projection of a coordinate onto the itinerary graph.

Link copied to clipboard
open override fun toCompactString(): String

Returns a compact, human-readable representation of this value.

Link copied to clipboard
open override fun toString(): String

Returns the itinerary's endpoints and totals, with legs reduced to its size.