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:
VehicleSpecification.currentWeightInKilogramsfromTransportSpecification.vehicleSpecificationfromRoutingOptions.transportSpecification- 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.
-
Defines the transport specification which contains the transport mode and the vehicle specifications for the transport mode chosen. Notes:
- The transport mode
TransportMode.publicTransitis not supported. - By default all vehicle specifications from
RoutingOptions.transportSpecificationare set toniland theTransportSpecification.transportModefromRoutingOptions.transportSpecificationis set toTransportMode.car. - A route can be calculated with only the
TransportSpecification.transportModefromRoutingOptions.transportSpecificationset. - It is highly recommended to define the
TruckCategorythat is being used inVehicleSpecification.truckCategoryfromTransportSpecification.vehicleSpecificationfromRoutingOptions.transportSpecification, if theTransportSpecification.transportModefromRoutingOptions.transportSpecificationis set toTransportMode.truck. - The
VehicleSpecification.occupancyfromTransportSpecification.vehicleSpecificationwon’t have effect if HOV and/or HOT lane usage is not allowed usingEVTruckOptions.allowOptions. - The
PedestrianSpecification.walkingSpeedInMetersPerSecondfromTransportSpecification.pedestrianSpecificationif 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) -
Returns the default configuration for the transport specification selected in
ParameterConfiguration.transportSpecificationfromSDKNativeEngine.parameterConfig. Note By default, the [sdk.core.ParameterConfiguration.transport_specification] from [sdk.core.engine.SDKNativeEngine.parameter_config] will return a validTransportSpecificationobject with the [sdk.transport.TransportSpecification.transport_mode] set toTransportMode.car.Declaration
Swift
public static func fromDefaultParameterConfiguration() -> RoutingOptionsReturn Value
The
RoutingOptionsobject with the default configuration for the transport specification selected inParameterConfiguration.transportSpecificationfromSDKNativeEngine.parameterConfig.