Routing for hazardous material

Products Used: Directions API & Navigation API


NextBillion.ai’s routing APIs also take into account the kind of material your vehicles are transporting. Use the “hazmat_type” parameter to describe the type of hazardous material that is being carried and the routing engine will only suggest the routes that are suitable for the vehicle to pass through. This feature ensures that the vehicle takes only the safe and legal routes to the destination.

Let’s take a look at the following request which makes use of

  1. An “origin” and “destination” for the trip
  2. “mode” option set to “truck”
  3. “option” attribute set to “flexible”
  4. “hazmat_type” indicating one of the recognized hazardous material types

Directions API request

1
curl --location 'https://api.nextbillion.io/directions/json?key=<your_api_key>&origin=48.22539980,-101.29602541&destination=48.24027183,-101.29608570&mode=truck&option=flexible&hazmat_type=circumstantial'

Directions API response

1
{
2
"status": "Ok",
3
"routes": "[...]"
4
}

Notice that if the “hazmat_type” configuration is removed from the input request the route suggested for a general truck is quite shorter than what is safe for a truck carrying hazardous material.

Let’s take a look at how a Navigation API call would look like for the exact same parameters as the above example.

1
curl --location 'https://api.nextbillion.io/navigation/json?key=<your_api_key>&origin=48.22539980,-101.29602541&destination=48.24027183,-101.29608570&mode=truck&option=flexible&hazmat_type=circumstantial'
1
{
2
"status": "Ok",
3
"routes": "[...]"
4
}

Visit product documentation (Directions API | Navigation API) to know more about the available features.

© 2024 NextBillion.ai all rights reserved.