> [!NOTE]
> **Note:** Large vehicle routing is available to a limited set of customers. [Contact us to express interest](https://developers.google.com/maps/documentation/routes/contact).

Large vehicle routing is a set of properties that lets you optimize fleet routes
for large vehicles by specifying physical dimensions, weight, and trailer
counts. The API uses these attributes to calculate feasible paths that avoid
restricted roads, low bridges, or weight-limited routes.

With large vehicle routing, you can solve fleet logistics challenges for heavy
and large vehicles, for example:

- **Avoid road hazards**: Generate route plans that steer vehicles away from low overhead clearances, weight-restricted roads, and other physical hazards.
- **Specify detailed vehicle information**: Incorporate precise dimensions, total weight, axle counts, and trailer configurations into fleet-wide route plans.
- **Improve fleet-wide planning**: Build efficient route plans for your entire truck fleet while ensuring that all assignments comply with physical road constraints.
- **Enable turn-by-turn navigation**: Generate route tokens for optimized fleet routes and pass them to the Navigation SDK to guide drivers with large vehicle-specific navigation.

## Limitations

Before you begin, you must be aware of the following limitations and
requirements.

- **Geographic availability** : Large vehicle routing is available only in the **contiguous 48 United States**.
- **Driver advisory and safety**: Drivers must not rely solely on routes returned by this API to be safe or legal. Routes are not guaranteed to be appropriate for the vehicle, and following them may expose drivers to hazards such as low bridges or roads where large vehicles are prohibited.
- **Best-effort routes**: In some cases, the API cannot find a route that fully complies with travel restrictions. Instead, it returns a "best effort" route that may still traverse restricted areas.
- **Unsupported features** : Large vehicle routing does not support the following:
  - Truck toll prices
  - Speed limits
  - Routing for radioactive hazardous materials
- **Billing:** Google bills all [`optimizeTours`](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/projects/optimizeTours) requests uniformly, regardless of whether the requests configure large vehicle routing properties.
- **Long-haul routes:** Long-haul truck routes spanning 500 or more kilometers require more computation time than shorter routes, and they might return lower-quality route data. To maintain route quality, limit distances between shipments, vehicle start locations, and vehicle end locations. If you require long routes, increase your request deadlines to reduce the likelihood of `DEADLINE_EXCEEDED` errors.

## Properties

To use large vehicle routing properties, you must configure a vehicle with its
physical dimensions and set its routing mode to truck.

The following table lists the top-level properties for configuring large vehicle
routing:

| Property | Type | Requirement | Description |
|---|---|---|---|
| `travelMode` | string | Required | Specifies the travel mode for the vehicle. To enable large vehicle routing properties, set this value to `TRUCK`. |
| `routeModifiers` | object | Required | Contains route-specific configurations, including `vehicleInfo`. |

### `vehicleInfo`

The [`vehicleInfo`](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/ShipmentModel#vehicleinfo) object contains the physical specifications of the
vehicle. Define this object within the [`routeModifiers`](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/ShipmentModel#Vehicle.FIELDS.route_modifiers) property.
**Providing the [`vehicleInfo`](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/ShipmentModel#vehicleinfo) object is required** if you set
[`travelMode`](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/ShipmentModel#Vehicle.FIELDS.travel_mode) to [`TRUCK`](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/ShipmentModel#TravelMode.ENUM_VALUES.TRUCK).

The following table lists the properties available within the [`vehicleInfo`](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/ShipmentModel#vehicleinfo)
object:

| Property | Type | Requirement | Description |
|---|---|---|---|
| `totalHeightMm` | integer | Required | Specifies the total height of the vehicle in millimeters. This value must be a positive integer. |
| `totalWidthMm` | integer | Required | Specifies the total width of the vehicle in millimeters. This value must be a positive integer. |
| `totalWeightKg` | integer | Required | Specifies the total weight of the vehicle in kilograms. This value must be a positive integer. |
| `totalLengthMm` | integer | Required | Specifies the total length of the vehicle in millimeters. This value must be a positive integer. |
| `trailerInfo` | array | Optional | Contains an array of trailer specifications, which includes the `lengthMm` property to specify the length of each individual trailer in millimeters. |
| `totalAxleCount` | integer | Required | Specifies the total number of axles on the vehicle. This value must be an integer greater than or equal to 2. |

## Examples

This section covers two types of examples:

- [Code sample](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/make-request.md.txt#code_sample) that illustrates the structure of large vehicle routing.
- [A request example](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/make-request.md.txt#request_example) that includes the feature.

### Code sample

The following example shows the structure of the properties used for large
vehicle routing:

```json
"vehicles": [
  {
    "travelMode": "TRUCK",
    "routeModifiers": {
      "vehicleInfo": {
        "totalHeightMm": TOTAL_HEIGHT_MM,
        "totalWidthMm": TOTAL_WIDTH_MM,
        "totalWeightKg": TOTAL_WEIGHT_KG,
        "totalLengthMm": TOTAL_LENGTH_MM,
        "trailerInfo": [
          {
            "lengthMm": TRAILER_LENGTH_MM
          }
        ],
        "totalAxleCount": TOTAL_AXLE_COUNT
      }
    }
  }
]
```

### Request example

The following example shows the structure of a basic [`optimizeTours`](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/projects/optimizeTours)
request incorporating large vehicle routing:

```json
{
  "model": {
    "shipments": [
      {
        "pickups": [
          {
            "arrivalLocation": {
              "latitude": 40.953523,
              "longitude": -72.2277846
            }
          }
        ],
        "deliveries": [
          {
            "arrivalLocation": {
              "latitude": 40.9546673,
              "longitude": -72.2580151
            }
          }
        ]
      }
    ],
    "vehicles": [
      {
        "travelMode": "TRUCK",
        "routeModifiers": {
          "vehicleInfo": {
            "totalHeightMm": 4000,
            "totalWidthMm": 2500,
            "totalWeightKg": 9000,
            "totalLengthMm": 20000,
            "trailerInfo": [
              {
                "lengthMm": 15000
              }
            ],
            "totalAxleCount": 5
          }
        },
        "costPerKilometer": 1.0
      }
    ]
  }
}
```

## What's next

- **Provide turn-by-turn navigation** : Learn how to pass the `routeToken` returned for each transition to the Navigation SDK for [Android](https://developers.google.com/maps/documentation/navigation/android-sdk/large-vehicle-navigation.md.txt) or [iOS](https://developers.google.com/maps/documentation/navigation/ios-sdk/large-vehicle-navigation.md.txt).
- **Generate transition polylines and route tokens** : Learn how to request route tokens using `populateTransitionPolylines` in [Transition polylines and route tokens](https://developers.google.com/maps/documentation/route-optimization/polylines-and-route-tokens.md.txt).
- **API reference** : View the full list of fields in the [`optimizeTours` reference](https://developers.google.com/maps/tt/route-optimization/experimental/truck-routing/reference/rest/v1/projects/optimizeTours).