Avoid Sharp turns and U-turns
Products Used: Directions API & Navigation API
NextBillion.ai’s routing APIs provide a powerful “avoid” parameter to configure routes to suit different business requirements of fleet management. Users can leverage the available options to avoid routing through highways, tolls, service roads and dangerous u-turns or sharp_turns. These features provide a high-degree of flexibility to serve the routing constraints of different vehicles as well as meet business requirements.
We will take a look at a couple of examples to see their impact on the suggested routes.
Avoid U turns
In this example, we will request a directions using the Directions API with
- An “origin” and “destination” for the pick-up van trip
- “mode” option set to “car”
- “avoid” configuration set to “uturn”
Directions API request
Directions API response
Notice that if the avoid option is removed from the input request the route suggested is quite different and does go through a highway.
Avoid service roads
In this example, we will request step-by-step instructions using the Navigation API to generate a route suitable for a freight truck by avoiding any sharp turns and u-turns. We specify:
- An “origin” and “destination”
- “mode” option set to “truck”
- “avoid” configuration set to “sharp_turn” and “uturn”
Navigation API request
Navigation API response
Visit product documentation (Directions API | Navigation API) to know more about the available features.