VehicleSpecification

public struct VehicleSpecification : Hashable

Contains vehicle related attributes. Examples: Dimensions, weight, axle count. Only the fields that are set are considered for restriction handling. 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.

  • Vehicle height in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.

    Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

    Declaration

    Swift

    public var heightInCentimeters: Int32?
  • Vehicle width in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.

    Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

    Declaration

    Swift

    public var widthInCentimeters: Int32?
  • Vehicle length in centimeters. The provided value must be in the range [0, 30000]. By default, it is not set.

    Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

    Declaration

    Swift

    public var lengthInCentimeters: Int32?
  • Defines total number of axles in the vehicle. The provided value must be greater than or equal to 2. By default, it is not set. Route calculation: When not set, possible axle count restrictions will not be taken into consideration. Rendering: When set, truck restriction icons for an axle count greater than VehicleSpecification.axleCount will not be displayed. When specifying VehicleSpecification.trailerAxleCount, then VehicleSpecification.axleCount is required and must be greater than VehicleSpecification.trailerAxleCount.

    Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

    Declaration

    Swift

    public var axleCount: Int32?
  • Defines number of trailers attached to the vehicle. The provided value must be in the range [0, 255]. By default, it is not set. When specifying VehicleSpecification.trailerAxleCount, then VehicleSpecification.trailerCount is required and must be greater than 0.

    Declaration

    Swift

    public var trailerCount: Int32?
  • Will be replaced with truckCategory when the TruckSpecification will be replaced by VehicleSpecification. Defines the type of truck. Defaults to TruckType.straight. Rendering sdk.mapview.TruckProfile: VehicleSpecification.truckType is ignored and has no effect.

    Declaration

    Swift

    public var truckType: TruckType
  • Defines the truck category. By default, it is not set. Rendering: VehicleSpecification.truckCategory is ignored and has no effect.

    Declaration

    Swift

    public var truckCategory: TruckCategory?
  • A flag indicating whether the truck is light enough to be classified more as a car than a truck in Japan. The flag should not be set to true in other countries than Japan. Defaults to false.

    A light truck exempts from many legal restrictions for normal trucks in Japan, for example, which streets the vehicle can access, which access restrictions apply, and which speed limits are applicable. Restrictions related to the dimensions of the truck, or its cargo may still apply and setting this flag will not always overwrite these settings. Make sure to not exceed the specifications that classify a truck as light.

    In Japan, for light trucks the same restrictions apply as for cars. Therefore, when the flag is set to true, you will get, for example, the same speed limits as for cars. Make sure to set the flag only to true, when a vehicle matches the classification for light trucks according to the vehicle regulations in Japan.

    When on MapContentSettings, then this flag will be ignored and has no effect.

    Notes:

    • This flag and the concept of light trucks are supported only in Japan as beta and are considered to be experimental in other regions. Therefore, for now, it is recommended to use this flag only in Japan. Note that 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.
    • Supported only in TransportMode.truck transport mode.

    Declaration

    Swift

    public var isTruckLight: Bool
  • Allowed payload capacity, including trailers, specified in kilograms. The provided value must be greater then or equal to 0. By default, it is not set.

    Note: Supported in TransportMode.truck, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

    Declaration

    Swift

    public var payloadCapacityInKilograms: Int32?
  • Defines total number of axles across all the trailers attached to the vehicle. This number is included in VehicleSpecification.axleCount, hence VehicleSpecification.trailerAxleCount must be less than VehicleSpecification.axleCount and greater than or equal to 1. VehicleSpecification.axleCount and VehicleSpecification.trailerCount are required to specify VehicleSpecification.trailerAxleCount. By default, it is not set.

    Note:: This parameter is currently used only for the calculation of tolls in regions where it is applicable.

    Declaration

    Swift

    public var trailerAxleCount: Int32?
  • Gross truck weight, including trailers and shipped goods when loaded at capacity, specified in kilograms. The provided value must be greater than or equal to 0. If unspecified, it will default to VehicleSpecification.currentWeightInKilograms. By default, it is not set.

    Notes:

    Declaration

    Swift

    public var grossWeightInKilograms: Int32?
  • Current truck weight, including trailers and shipped goods currently loaded, specified in kilograms. The provided value must be greater than or equal to 0. If unspecified, it will default to VehicleSpecification.grossWeightInKilograms. By default, it is not set.

    Notes:

    Declaration

    Swift

    public var currentWeightInKilograms: Int32?
  • Heaviest weight per axle, regardless of axle type or axle group. It is evaluated against all axle weight restrictions, including single axle and tandem axle weight restrictions. The provided value must be greater or equal to 0. By default, it is not set.

    Notes:

    Declaration

    Swift

    public var weightPerAxleInKilograms: Int32?
  • Allows specification of axle weights in a more fine-grained way than VehicleSpecification.weightPerAxleInKilograms. This is relevant in countries with signs and regulations that specify different limits for different axle groups, like the USA and Sweden. By default is not set.

    Notes:

    Declaration

    Swift

    public var weightPerAxleGroup: WeightPerAxleGroup?
  • Specifies whether the vehicle is a commercial or a non-commercial vehicle. Defaults to false.

    Notes

    Declaration

    Swift

    public var isCommercial: Bool
  • Last character of license plate in String format. This value can be used to evaluate restrictions in environmental zones. By default, it is not set.

    Declaration

    Swift

    public var lastCharacterOfLicensePlate: String?
  • Engine size of the scooter in cubic centimeters. Shouldn’t be less than 1 or greater than 65535. Default value is nil, which means the scooter route calculation ignores all engine size limits on the road.

    Notes

    • For now, this option is only relevant in Japan and will be ignored for other countries. Currently, map data for this option is only available for Japan.
    • Supported only in TransportMode.scooter (Alpha) transport mode.

    Declaration

    Swift

    public var engineSizeInCubicCentimeters: Int32?
  • The total number of tires the vehicle has, i.e., the tires on the base vehicle and any attached trailers. By default, it is not set. Otherwise it is guaranteed to be in the range [1, 255].

    Note: This parameter is not supported in isoline routing.

    Declaration

    Swift

    public var tiresCount: Int32?
  • Specifies the tunnel categories to restrict certain route links. The route will pass only through tunnels of a less strict category. Refer to TunnelCategory for the available options. By default, it is not set.

    Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

    Declaration

    Swift

    public var tunnelCategory: TunnelCategory?
  • Specifies a list of hazardous materials shipped in the vehicle. Refer to HazardousMaterial for the available options. By default, it is an empty list.

    Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

    Declaration

    Swift

    public var hazardousMaterials: [HazardousMaterial]
  • 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. By default, it is not set.

    Declaration

    Swift

    public var occupancy: Int32?
  • Will be moved to TaxiSpecification. Specifies if a vehicle is allowed to drive through the taxi-only roads and lanes. When set to false, it is still allowed on taxi roads after the route start and before the route destination. Defaults to false.

    Declaration

    Swift

    public var allowDriveThroughTaxiRoads: Bool
  • Will be moved to ScooterSpecification. Specifies whether scooter is allowed on highway or not. True means scooter is allowed to use highways and false means otherwise. By default it is set to false. Note that there is a similar parameter in AvoidanceOptions, to disallow highway usage, see RoadFeatures.CONTROLLED_ACCESS_HIGHWAY. As the avoidance options takes precedence, if this parameter is also used, then scooters are not allowed to use highways even if allowHighway is set to true. However, if no alternative route is possible, the calculated route may use highways. In such a case, a SectionNotice will be provided in the related Section to indicate that the highway usage restriction is violated on this route. A few examples:

    1 - If no avoidance option is set, and allowHighway = false, when no route is found without highway usage, a notice is received.

    2 - If no avoidance option is set, and allowHighway = true, when no route is found without highway usage, no notice is received.

    3 - If only avoid[features] = controlledAccessHighway is set, when no route is found without highway usage, a notice is received.

    4 - If both avoid[features] = controlledAccessHighway and allowHighway = true are set, when no route is found without highway usage, a notice is received. Defaults to false.

    Declaration

    Swift

    public var allowScooterOnHighway: Bool
  • Creates a new instance.

    • Parameters

      • heightInCentimeters: Vehicle height in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.

      Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

      • widthInCentimeters: Vehicle width in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.

      Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

      • lengthInCentimeters: Vehicle length in centimeters. The provided value must be in the range [0, 30000]. By default, it is not set.

      Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

      Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

      • trailerCount: Defines number of trailers attached to the vehicle. The provided value must be in the range [0, 255]. By default, it is not set. When specifying VehicleSpecification.trailerAxleCount, then VehicleSpecification.trailerCount is required and must be greater than 0.
      • truckType: Will be replaced with truckCategory when the TruckSpecification will be replaced by VehicleSpecification. Defines the type of truck. Defaults to TruckType.straight. Rendering sdk.mapview.TruckProfile: VehicleSpecification.truckType is ignored and has no effect.
      • truckCategory: Defines the truck category. By default, it is not set. Rendering: VehicleSpecification.truckCategory is ignored and has no effect.
      • isTruckLight: A flag indicating whether the truck is light enough to be classified more as a car than a truck in Japan. The flag should not be set to true in other countries than Japan. Defaults to false.

      A light truck exempts from many legal restrictions for normal trucks in Japan, for example, which streets the vehicle can access, which access restrictions apply, and which speed limits are applicable. Restrictions related to the dimensions of the truck, or its cargo may still apply and setting this flag will not always overwrite these settings. Make sure to not exceed the specifications that classify a truck as light.

      In Japan, for light trucks the same restrictions apply as for cars. Therefore, when the flag is set to true, you will get, for example, the same speed limits as for cars. Make sure to set the flag only to true, when a vehicle matches the classification for light trucks according to the vehicle regulations in Japan.

      When on MapContentSettings, then this flag will be ignored and has no effect.

      Notes:

      • This flag and the concept of light trucks are supported only in Japan as beta and are considered to be experimental in other regions. Therefore, for now, it is recommended to use this flag only in Japan. Note that 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.
      • Supported only in TransportMode.truck transport mode.
        • payloadCapacityInKilograms: Allowed payload capacity, including trailers, specified in kilograms. The provided value must be greater then or equal to 0. By default, it is not set.

      Note: Supported in TransportMode.truck, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

      Note:: This parameter is currently used only for the calculation of tolls in regions where it is applicable.

      • grossWeightInKilograms: Gross truck weight, including trailers and shipped goods when loaded at capacity, specified in kilograms. The provided value must be greater than or equal to 0. If unspecified, it will default to VehicleSpecification.currentWeightInKilograms. By default, it is not set.

      Notes:

      Notes:

      Notes:

      Notes:

      Notes

      • Only supported for online routing.
      • This parameter is currently used only for the calculation of tolls in regions where it is applicable.
      • Not used for offline calculations.
      • Supported for TransportMode.car, TransportMode.truck, TransportMode.bus, TransportMode.privateBus and TransportMode.taxi.
        • lastCharacterOfLicensePlate: Last character of license plate in String format. This value can be used to evaluate restrictions in environmental zones. By default, it is not set.
        • engineSizeInCubicCentimeters: Engine size of the scooter in cubic centimeters. Shouldn’t be less than 1 or greater than 65535. Default value is nil, which means the scooter route calculation ignores all engine size limits on the road.

      Notes

      • For now, this option is only relevant in Japan and will be ignored for other countries. Currently, map data for this option is only available for Japan.
      • Supported only in TransportMode.scooter (Alpha) transport mode.
        • tiresCount: The total number of tires the vehicle has, i.e., the tires on the base vehicle and any attached trailers. By default, it is not set. Otherwise it is guaranteed to be in the range [1, 255].

      Note: This parameter is not supported in isoline routing.

      • tunnelCategory: Specifies the tunnel categories to restrict certain route links. The route will pass only through tunnels of a less strict category. Refer to TunnelCategory for the available options. By default, it is not set.

      Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

      • hazardousMaterials: Specifies a list of hazardous materials shipped in the vehicle. Refer to HazardousMaterial for the available options. By default, it is an empty list.

      Note: Supported in TransportMode.truck, TransportMode.bus, TransportMode.privateBus, TransportMode.car (Beta), TransportMode.taxi (Beta) transport modes.

      • occupancy: 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. By default, it is not set.
      • allowDriveThroughTaxiRoads: Will be moved to TaxiSpecification. Specifies if a vehicle is allowed to drive through the taxi-only roads and lanes. When set to false, it is still allowed on taxi roads after the route start and before the route destination. Defaults to false.
      • allowScooterOnHighway: Will be moved to ScooterSpecification. Specifies whether scooter is allowed on highway or not. True means scooter is allowed to use highways and false means otherwise. By default it is set to false. Note that there is a similar parameter in AvoidanceOptions, to disallow highway usage, see RoadFeatures.CONTROLLED_ACCESS_HIGHWAY. As the avoidance options takes precedence, if this parameter is also used, then scooters are not allowed to use highways even if allowHighway is set to true. However, if no alternative route is possible, the calculated route may use highways. In such a case, a SectionNotice will be provided in the related Section to indicate that the highway usage restriction is violated on this route. A few examples:

      1 - If no avoidance option is set, and allowHighway = false, when no route is found without highway usage, a notice is received.

      2 - If no avoidance option is set, and allowHighway = true, when no route is found without highway usage, no notice is received.

      3 - If only avoid[features] = controlledAccessHighway is set, when no route is found without highway usage, a notice is received.

      4 - If both avoid[features] = controlledAccessHighway and allowHighway = true are set, when no route is found without highway usage, a notice is received. Defaults to false.

    Declaration

    Swift

    public init(heightInCentimeters: Int32? = nil, widthInCentimeters: Int32? = nil, lengthInCentimeters: Int32? = nil, axleCount: Int32? = nil, trailerCount: Int32? = nil, truckType: TruckType = TruckType.straight, truckCategory: TruckCategory? = nil, isTruckLight: Bool = false, payloadCapacityInKilograms: Int32? = nil, trailerAxleCount: Int32? = nil, grossWeightInKilograms: Int32? = nil, currentWeightInKilograms: Int32? = nil, weightPerAxleInKilograms: Int32? = nil, weightPerAxleGroup: WeightPerAxleGroup? = nil, isCommercial: Bool = false, lastCharacterOfLicensePlate: String? = nil, engineSizeInCubicCentimeters: Int32? = nil, tiresCount: Int32? = nil, tunnelCategory: TunnelCategory? = nil, hazardousMaterials: [HazardousMaterial] = [], occupancy: Int32? = nil, allowDriveThroughTaxiRoads: Bool = true, allowScooterOnHighway: Bool = false)