RoutingOptions
public struct RoutingOptions : Hashable
The options defines how a route should be calculated.
The options are used for all transport modes and engines.
** Electric vehicle specific requirements ** Electric vehicle consumption are estimated when at least one consumption model is defined. Currently two models are supported:
- PhysicalConsumptionModel
Aside from the values in PhysicalConsumptionModel additionally these values needs to be defined:
RoutingOptions.transport_specification.vehicle_specification.current_weight_in_kilograms- Additionally
Waypoint.currentWeightChangeInKilogramscan be defined.
- EmpiricalConsumptionModel
By setting ElectricVehicleOptions.ensureReachability the RoutingEngine inserts additional charging stations
to reach the waypoints.
This feature requires setting the BatterySpecifications.
By default a vehicle might not reach the waypoint, when the initial charge is not enough to reach all waypoints.
See the parameter description below for more details.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Defines the transport specification which contains the transport mode and the vehicle specifications for the transport mode chosen. By default generic vehicle specifications for the chosen transport mode are used. Notes:
- The transport mode
TransportMode.PUBLIC_TRANSITis not supported. - It is highly recommended to define the
truckCategorythat is being used, if thetransportModeis set toTransportMode.TRUCK. - The
TransportSpecification.vehicleSpecification.occupancywon’t have effect if HOV and/or HOT lane usage is not allowed usingEVTruckOptions.allowOptions. - The
TransportSpecification.pedestrianSpecification.walkSpeedInMetersPerSecondif present, will be used by the service as the walking speed for pedestrian routing. It influences the duration of walking along the route. The provided value must be in the range [0.5, 2.0]. When the value is outside this range, an invalid parameter error is raised. Refer toRoutingErrorfor details. The default speed is 1 meter per second.
Declaration
Swift
public var transportSpecification: TransportSpecification - The transport mode
-
Specifies the common route calculation options.
Declaration
Swift
public var routeOptions: RouteOptions -
Customize textual content returned from the route calculation, such as localization, format, and unit system.
Declaration
Swift
public var textOptions: RouteTextOptions -
Options to specify restrictions for route calculations. By default no restrictions are applied.
Declaration
Swift
public var avoidanceOptions: AvoidanceOptions -
The options explicitly allowed by user for route calculations. By default no options are opt in.
Declaration
Swift
public var allowOptions: AllowOptions -
Options to specify how the tolls should be calculated, such as transponders, vehicle category, and emission type. Note Not used for offline calculations.
Declaration
Swift
public var tollOptions: TollOptions -
Segments with restriction on maximum
DynamicSpeedInfo.baseSpeedInMetersPerSecond. Note Not used for offline calculations.Declaration
Swift
public var maxSpeedOnSegments: [MaxSpeedOnSegment] -
Defines the electric vehicle (EV) related parameters to calculate the consumption and reachability. When no EV options are defined an internal combustion engine is assumed.
Declaration
Swift
public var evOptions: ElectricVehicleOptions? -
init(transportSpecification:routeOptions: textOptions: avoidanceOptions: allowOptions: tollOptions: maxSpeedOnSegments: evOptions: ) Creates a new instance.
Declaration
Swift
public init(transportSpecification: TransportSpecification = TransportSpecification(), routeOptions: RouteOptions = RouteOptions(), textOptions: RouteTextOptions = RouteTextOptions(), avoidanceOptions: AvoidanceOptions = AvoidanceOptions(), allowOptions: AllowOptions = AllowOptions(), tollOptions: TollOptions = TollOptions(), maxSpeedOnSegments: [MaxSpeedOnSegment] = [], evOptions: ElectricVehicleOptions? = nil)