Travel mode - Amazon Location Service

Travel mode

You can set a travel mode when using CalculateRoute or CalculateRouteMatrix. The mode of travel affects speed of travel and road compatibility. While the default mode of travel is by car, you can specify which mode of travel you're using while traveling along a route with the following optional parameter:

  • TravelMode – Specifies the mode of transport when calculating a route, such as: Car, Truck, or Walking.

Note

If you specify Walking for the travel mode and your data provider is Esri, the start and destination must be within 40km.

If you specify a TravelMode of Car, you can specify additional route preferences with the following optional parameter:

  • CarModeOptions – Specifies route preferences when traveling in a car, such as AvoidFerries or AvoidTolls.

If you specify a TravelMode of Truck, you can specify additional route preferences with the following optional parameter:

  • TruckModeOptions – Specifies route preferences when traveling in a truck, such as AvoidFerries or AvoidTolls, in addition to specifying routes that can accommodate the TruckDimensions and TruckWeight.

The following CalculateRoute request specifies Truck as the mode of travel. Additional route restrictions include: avoiding routes that use ferries and avoiding roads that can't accommodate the truck dimensions and weight.

{ "DeparturePosition": [-122.7565,49.0021], "DestinationPosition": [-122.3394, 47.6159], "DepartNow": true, "TravelMode": "Truck", "TruckModeOptions": { "AvoidFerries": true, "AvoidTolls": false, "Dimensions": { "Height": 4.5, "Length": 15.5, "Unit": "Meters", "Width": 4.5 }, "Weight": { "Total": 7500, "Unit": "Pounds" } } }