TruckSpecifications
public struct TruckSpecifications : Hashable
Truck specifications contain vehicle related attributes. Examples: Dimensions, weight, axle count. Only the fields that are set are considered for restriction handling.
-
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
TruckSpecifications.currentWeightInKilograms. By default, it is not set.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
TruckSpecifications.grossWeightInKilograms. By default, it is not set.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. Note:
weight_per_axle_in_kilogramsandweight_per_axle_groupare incompatible. When available for your edition, if both attributes are set, during online RoutingEngine an [sdk.routing.RoutingError.INVALID_PARAMETER] error is generated. Otherwise, when offline RoutingEngine is in place, both parameters are evaluated and the maximum value between them will be used.Declaration
Swift
public var weightPerAxleInKilograms: Int32? -
Allows specification of axle weights in a more fine-grained way than
weight_per_axle_in_kilograms. 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. Note:weight_per_axle_in_kilogramsandweight_per_axle_groupare incompatible. When available for your edition, if both attributes are set, during online RoutingEngine an [sdk.routing.RoutingError.INVALID_PARAMETER] error is generated. Otherwise, when offline RoutingEngine is in place, both parameters are evaluated and the maximum value between them will be used.Declaration
Swift
public var weightPerAxleGroup: WeightPerAxleGroup? -
Truck height in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.
Declaration
Swift
public var heightInCentimeters: Int32? -
Truck width in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.
Declaration
Swift
public var widthInCentimeters: Int32? -
Truck length in centimeters. The provided value must be in the range [0, 30000]. By default, it is not set.
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
sdk.mapview.TruckProfile: When set, truck restriction icons for an axle count greater thanTruckSpecifications.axleCountwill not be displayed. When specifyingTruckSpecifications.trailerAxleCount, thenTruckSpecifications.axleCountis required and must be greater thanTruckSpecifications.trailerAxleCount.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
TruckSpecifications.trailerAxleCount, thenTruckSpecifications.trailerCountis required and must be greater than 0.Declaration
Swift
public var trailerCount: Int32? -
Defines the type of truck. By default, it is
TruckType.straight. Renderingsdk.mapview.TruckProfile:TruckSpecifications.truckTypeis ignored and has no effect.Declaration
Swift
public var truckType: TruckType -
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
truein other countries than Japan. The flag defaults tofalse.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
TruckSpecificationsare set as part ofMapContentSettings, then this flag will be ignored and has no effect.Note: 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 with a deprecation process.
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.
Declaration
Swift
public var payloadCapacityInKilograms: Int32? -
Defines total number of axles across all the trailers attached to the vehicle. This number is included in
TruckSpecifications.axleCount, henceTruckSpecifications.trailerAxleCountmust be less thanTruckSpecifications.axleCountand greater than or equal to 1.TruckSpecifications.axleCountandTruckSpecifications.trailerCountare required to specifyTruckSpecifications.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? -
init(grossWeightInKilograms:currentWeightInKilograms: weightPerAxleInKilograms: weightPerAxleGroup: heightInCentimeters: widthInCentimeters: lengthInCentimeters: axleCount: trailerCount: truckType: isTruckLight: payloadCapacityInKilograms: trailerAxleCount: ) Creates a new instance.
Parameters
- 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
TruckSpecifications.currentWeightInKilograms. By default, it is not set. - currentWeightInKilograms: 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
TruckSpecifications.grossWeightInKilograms. By default, it is not set. - weightPerAxleInKilograms: 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.
Note:
weight_per_axle_in_kilogramsandweight_per_axle_groupare incompatible. When available for your edition, if both attributes are set, during online RoutingEngine an [sdk.routing.RoutingError.INVALID_PARAMETER] error is generated. Otherwise, when offline RoutingEngine is in place, both parameters are evaluated and the maximum value between them will be used. - weightPerAxleGroup: Allows specification of axle weights in a more fine-grained way than
weight_per_axle_in_kilograms. 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. Note:weight_per_axle_in_kilogramsandweight_per_axle_groupare incompatible. When available for your edition, if both attributes are set, during online RoutingEngine an [sdk.routing.RoutingError.INVALID_PARAMETER] error is generated. Otherwise, when offline RoutingEngine is in place, both parameters are evaluated and the maximum value between them will be used. - heightInCentimeters: Truck height in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.
- widthInCentimeters: Truck width in centimeters. The provided value must be in the range [0, 5000]. By default, it is not set.
- lengthInCentimeters: Truck length in centimeters. The provided value must be in the range [0, 30000]. By default, it is not set.
- axleCount: 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
sdk.mapview.TruckProfile: When set, truck restriction icons for an axle count greater thanTruckSpecifications.axleCountwill not be displayed. When specifyingTruckSpecifications.trailerAxleCount, thenTruckSpecifications.axleCountis required and must be greater thanTruckSpecifications.trailerAxleCount. - 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
TruckSpecifications.trailerAxleCount, thenTruckSpecifications.trailerCountis required and must be greater than 0. - truckType: Defines the type of truck. By default, it is
TruckType.straight. Renderingsdk.mapview.TruckProfile:TruckSpecifications.truckTypeis 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
truein other countries than Japan. The flag defaults tofalse.
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
TruckSpecificationsare set as part ofMapContentSettings, then this flag will be ignored and has no effect.Note: 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 with a deprecation process.
- 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.
- trailerAxleCount: Defines total number of axles across all the trailers attached to the vehicle.
This number is included in
TruckSpecifications.axleCount, henceTruckSpecifications.trailerAxleCountmust be less thanTruckSpecifications.axleCountand greater than or equal to 1.TruckSpecifications.axleCountandTruckSpecifications.trailerCountare required to specifyTruckSpecifications.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.
- 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
Declaration
Swift
public init(grossWeightInKilograms: Int32? = nil, currentWeightInKilograms: Int32? = nil, weightPerAxleInKilograms: Int32? = nil, weightPerAxleGroup: WeightPerAxleGroup? = nil, heightInCentimeters: Int32? = nil, widthInCentimeters: Int32? = nil, lengthInCentimeters: Int32? = nil, axleCount: Int32? = nil, trailerCount: Int32? = nil, truckType: TruckType = TruckType.straight, isTruckLight: Bool = false, payloadCapacityInKilograms: Int32? = nil, trailerAxleCount: Int32? = nil)