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:

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 ** The optional parameters are mainly optional for the pedestrian transport mode. It is highly recommended to set RoutingOptions.vehicle and RoutingOptions.transportedCargo when the values are known. 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 mode.

    ** Note:** The transport mode TransportMode.PUBLIC_TRANSIT is not supported.

    Declaration

    Swift

    public var transportMode: TransportMode
  • Specifies the number of occupants in the vehicle, including driver, can affect the vehicle’s ability to use HOV/carpool restricted lanes. Should not be less than 1 or greater than 255. Defaults to 1.

    Note: This parameter won’t have effect if HOV and/or HOT lane usage is not allowed using EVTruckOptions.allowOptions

    Declaration

    Swift

    public var occupantsNumber: Int32
  • Defines the common route options.

    Declaration

    Swift

    public var commonRouteOptions: CommonRouteOptions
  • Defines the vehicle. By default a generic vehicle for the transport mode is used. It is highly recommended to define the truck that is used.

    Declaration

    Swift

    public var vehicle: VehicleSpecification?
  • 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?
  • Defines the transported cargo. The weight is used for restrictions and consumption prediction for electric vehicles.

    Declaration

    Swift

    public var transportedCargo: TransportedCargo?
  • Specifies the speed that will be used by the service as the walking speed for pedestrian routing in meters per second. It influences the duration of walking segments 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 to RoutingError for details. The default speed is 1 meter per second.

    Declaration

    Swift

    public var walkSpeedInMetersPerSecond: Double
  • Creates a new instance.

    • Parameters

      • transportMode: Defines the transport mode.

      ** Note:** The transport mode TransportMode.PUBLIC_TRANSIT is not supported.

      • occupantsNumber: Specifies the number of occupants in the vehicle, including driver, can affect the vehicle’s ability to use HOV/carpool restricted lanes. Should not be less than 1 or greater than 255. Defaults to 1.

      Note: This parameter won’t have effect if HOV and/or HOT lane usage is not allowed using EVTruckOptions.allowOptions

      • commonRouteOptions: Defines the common route options.
      • vehicle: Defines the vehicle. By default a generic vehicle for the transport mode is used. It is highly recommended to define the truck that is used.
      • evOptions: 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.
      • transportedCargo: Defines the transported cargo. The weight is used for restrictions and consumption prediction for electric vehicles.
      • walkSpeedInMetersPerSecond: Specifies the speed that will be used by the service as the walking speed for pedestrian routing in meters per second. It influences the duration of walking segments 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 to RoutingError for details. The default speed is 1 meter per second.

    Declaration

    Swift

    public init(transportMode: TransportMode = TransportMode.car, occupantsNumber: Int32 = 1, commonRouteOptions: CommonRouteOptions = CommonRouteOptions(), vehicle: VehicleSpecification? = nil, evOptions: ElectricVehicleOptions? = nil, transportedCargo: TransportedCargo? = nil, walkSpeedInMetersPerSecond: Double = 1.0)