RoutePlanningOptions

@RestrictToExtendedFlavor(value = [ExternalScope.LIBRARY_GROUP])
constructor(itinerary: Itinerary, costModel: CostModel? = CostModel(), departAt: Date? = null, arriveAt: Date? = null, alternativeRoutesOptions: AlternativeRoutesOptions? = null, guidanceOptions: GuidanceOptions? = null, routeLegOptions: List<RouteLegOptions> = emptyList(), vehicle: Vehicle = Vehicle.Car(), chargingOptions: ChargingOptions? = null, queryOptions: QueryOptions? = null, waypointOptimization: WaypointOptimization? = null, mode: RouteInformationMode = RouteInformationMode.Complete, arrivalSidePreference: ArrivalSidePreference = ArrivalSidePreference.AnySide)

Options for planning routes, which are passed to one of the various route planners.

Parameters

itinerary

The list of route locations. Note: Itinerary.planningTime will be overwritten by departAt/arriveAt in case they are set.

costModel

Options governing which streets to prefer.

departAt

A departure time for the route. Cannot be used together with arriveAt.

arriveAt

An arrival time for the route. Cannot be used together with departAt.

alternativeRoutesOptions

Options for calculating more than one route.

guidanceOptions

Properties for the generated instructions. Specify null for no instructions generation.

routeLegOptions

Options for each route leg, such as a polyline to follow.

vehicle

The vehicle dimensions, restrictions, and engine parameters. When guidanceOptions are given, the vehicle has to be of type VehicleType.Car, VehicleType.Motorcycle or VehicleType.Truck. Please use VehicleType.Car for VehicleType.Taxi.

chargingOptions

Additional options for electric vehicles to take charging into account.

queryOptions

Options regarding the way the request is sent to the server.

waypointOptimization

Specifies whether to optimize the order of waypoints, and if so, how.

mode

Specifies how much guidance information (instructions and lane guidance) is returned with the route. Defaults to RouteInformationMode.Complete.

arrivalSidePreference

Specifies the road side on arrival preference for waypoints and destination.

Throws

if an invalid combination of options is used. Invalid combinations are:

  • using non-zero pauseTime for the origin or destination

  • using departAt and arriveAt at the same time.

  • using alternativeRoutesOptions.maxAlternatives with waypointOptimization other than WaypointOptimization.None

  • using alternativeRoutesOptions.minDeviationTime or alternativeRoutesOptions.minDeviationDistance with empty routeLegOptions or less than 2 supporting points in any leg

  • using arriveAt with AlternativeRoutesOptions.minDeviationTime or AlternativeRoutesOptions.minDeviationDistance

  • using routeLegOptions where any leg has only 1 supporting point.

  • using Motorized with combustion and electric engines at the same time

  • using Motorized with weight less than or equal to 0 when combustion or electric engine efficiency is set

  • using chargingOptions with

    • a non-motorized vehicle

    • a motorized vehicle without an electric engine

    • an electric vehicle without a charge level

    • chargingOptions.minChargeAtDestination greater than chargeLevel.maxCharge

    • chargingOptions.minChargeAtChargingStops greater than half of chargeLevel.maxCharge and vehicle.modelId not set

    • waypointOptimization other than WaypointOptimization.None

    • costModel.routeType other than RouteType.Fast

    • costModel.considerTraffic other than ConsiderTraffic.Yes; this limitation is applicable

  • using reconstructionMode set to ReconstructionMode.Route with an itinerary in which the origin and destination coordinates do not match the first and last point of the supporting polyline respectively. for the Orbis map only

  • using path alternatives with waypoint optimization

  • using route- and leg-level routeType together

  • specifying different number of route leg options than the number of route legs based on the provided itinerary

  • using guidanceOptions with a vehicle other than VehicleType.Car, VehicleType.Motorcycle or VehicleType.Truck


@RestrictToExtendedFlavor(value = [ExternalScope.LIBRARY_GROUP])
constructor(itinerary: Itinerary, routeType: RouteType? = null, considerTraffic: ConsiderTraffic? = ConsiderTraffic.Yes, avoidOptions: AvoidOptions? = null, departAt: Date? = null, arriveAt: Date? = null, alternativeRoutesOptions: AlternativeRoutesOptions? = null, guidanceOptions: GuidanceOptions? = null, routeLegOptions: List<RouteLegOptions> = emptyList(), vehicle: Vehicle = Vehicle.Car(), chargingOptions: ChargingOptions? = null, queryOptions: QueryOptions? = null, waypointOptimization: WaypointOptimization? = null, mode: RouteInformationMode = RouteInformationMode.Complete, arrivalSidePreference: ArrivalSidePreference = ArrivalSidePreference.AnySide, reconstructionMode: ReconstructionMode? = null)

Options for planning routes, which are passed to one of the various route planners.

Parameters

itinerary

The list of route locations. Note: Itinerary.planningTime will be overwritten by departAt/arriveAt in case they are set.

routeType

General strategy for selecting roads during route calculation.

considerTraffic

Use live traffic in the route calculation.

avoidOptions

Avoidance criteria.

departAt

A departure time for the route. Cannot be used together with arriveAt.

arriveAt

An arrival time for the route. Cannot be used together with departAt.

alternativeRoutesOptions

Options for calculating more than one route.

guidanceOptions

Properties for the generated instructions. Specify null for no instructions generation.

routeLegOptions

Options for each route leg, such as a polyline to follow.

vehicle

The vehicle dimensions, restrictions, and engine parameters.

chargingOptions

Additional options for electric vehicles to take charging into account.

queryOptions

Options regarding the way the request is sent to the server.

waypointOptimization

Specifies whether to optimize the order of waypoints, and if so, how they are optimized.

mode

Specifies how much guidance information (instructions and lane guidance) is returned with the route. Defaults to RouteInformationMode.Complete.

arrivalSidePreference

Specifies the road side on arrival preference for waypoints and destination.

reconstructionMode

Defines the mode used for the route reconstruction. If the value is null and at least one routeLegOptions has supporting points it will be defaulted to ReconstructionMode.Track. If the value is ReconstructionMode.Route or the Itinerary.heading parameter is ignored.

Throws

if an invalid combination of options is used, such as specifying both departAt and arriveAt, or using chargingOptions with a com.tomtom.sdk.vehicle.CombustionEngine, or specifying reconstructionMode without supportingPoints in routeLegOptions, or ReconstructionMode.Route with an itinerary in which the origin and destination coordinates do not match the first and last point of the supporting polyline respectively, or having any leg in routeLegOptions with only 1 supporting point.