Avoid feature

Why UPS Trucks Never Turn Left – And How to Implement the Avoid Feature?

UPS trucks are well-known for their “no-left-turn” policy, a rule that has saved them millions in costs while improving safety and reducing environmental impact. This policy isn’t just a quirky operational decision – it’s rooted in efficiency. By avoiding left turns, UPS reduces fuel consumption, improves driver safety, and lowers carbon emissions.

In this article, we’ll explore why UPS implemented this policy and how you can implement a similar strategy using NextBillion.ai’s APIs with the avoid feature.

The Concept Behind No-Left Turn

The no-left-turn concept originated as a response to the inefficiencies and risks associated with left turns, particularly in urban environments. Turning left often requires crossing multiple lanes of traffic, leading to increased waiting times, fuel consumption, and accident risks. 
no left turn copy

Delivery companies, like UPS, recognized that eliminating left turns could optimize their routes by reducing delays and improving safety. This idea is now a standard practice for logistics operations aiming for efficiency and sustainability.

Examples of Cities and Delivery Companies


UPS is the most well-known company that adopted the no-left-turn policy, and it has been using it across its fleet for decades. Their ORION system is built specifically to avoid left turns unless necessary, drastically improving their route efficiency. 

Other delivery companies, including primary ride-sharing services like Uber and Careem, have adopted similar policies, particularly in cities with high traffic volumes like San Francisco and Los Angeles, where left turns are often restricted or time-consuming.

Statistics Showing the Benefits


The no-left-turn strategy has been proven to deliver significant benefits:

  • Fuel Savings: UPS saves more than 10 million gallons annually by minimizing left turns.
  • Improved Safety: Vehicles turning left are three times more likely to be involved in fatal accidents, especially with pedestrians. Avoiding left turns leads to safer journeys for both drivers and pedestrians.
  • Reduced Carbon Emissions: By optimizing routes, UPS prevents over 100,000 metric tons of carbon emissions each year, contributing to a cleaner environment.

This data highlights the substantial operational, safety and environmental benefits of reducing left turns in delivery routes.

When planning routes, companies often need to optimize for various factors like cost, time, and safety. The ‘avoid’ feature of a Route Optimization API allows businesses to configure routes by specifying elements to bypass, such as toll roads, ferries, or highways. This ensures smoother and more cost-effective deliveries tailored to business needs.

Why Use the Avoid Feature in Route Planning?

The ’avoid’ feature can be used in the route optimization process for the following reasons:

Why use avoid feature

Cost Efficiency


Avoiding toll roads can lead to significant cost savings for companies handling large fleets or high-frequency deliveries.

Example: A delivery company in a city with numerous toll roads can use the ‘avoid’ feature to bypass tolls, leading to lower operational costs.

 

Improved Safety


Some routes, such as those involving sharp turns or ferries, may introduce risks. By avoiding these, companies can ensure safer routes for their drivers.

Example: Avoiding sharp turns reduces the risk of accidents, particularly for larger trucks or those carrying fragile goods.

Customized Routing


The ability to specify which elements to avoid allows businesses to customize routes based on their specific needs, whether it’s to reduce fuel consumption, avoid specific areas, or ensure timely deliveries.

Example: A fleet management company might avoid highways during rush hour to reduce delays and optimize delivery schedules.

How Does the Avoid Feature Work?

The avoid feature in NextBillion.ai APIs is all about giving you control over your routes. It helps you avoid certain things like tolls, ferries, highways, or even specific turns, so you can plan more efficient and safer routes.

Setting Up the Avoid Feature


When you’re optimizing a route, you can use the avoid parameter to tell the system what you want to avoid. You can select options like:

  • Tolls: Avoid paying toll fees on the route.

  • Ferries: Skip any ferry crossings.

  • Highways: Avoid highways if they’re not suitable for your vehicle or if they’re prone to traffic.

  • Service Roads: Stay away from smaller, less-traveled roads.

  • U-Turns and Sharp Turns: Skip difficult or potentially dangerous turns.


Here’s how it works
: you simply list what you want to avoid, separated by a pipe

(|). For example, if you want to avoid tolls and ferries, you’d enter:

avoid=toll|ferry

Important Rules to Remember


Route Type Matters
: The avoid feature only works if you’re optimizing the route for the fastest time. So make sure route_type=fastest.

Default Settings: If you don’t use the `avoid` parameter, the system automatically avoids ferries by default. If you want to keep ferries in your route, you’ll need to specify that.

What Happens if You Use ‘None’: If you try to mix none with other options like toll|none, you’ll get an error. That’s because the system can’t find a valid route when you tell it to avoid nothing and something else at the same time.

Special Cases: Bounding Boxes and Turn Angles


If you need even more control, you can use options like
bbox (bounding box) and sharp_turn to avoid specific areas or limit the type of turns your vehicles can make.

Avoiding Areas with Bounding Boxes: A bounding box is a geographical area you want to avoid. You define this area with coordinates, and the system won’t create a route that goes through that space. 

Here’s an example of how to set this up:

avoid=bbox:1.31886823,103.84655022,1.31926520,103.86013018


Just make sure the box doesn’t block off all possible routes, or you’ll get an error.

Sharp Turns: If you want to avoid sharp turns, the default turn angle range is between 120° and 240°. This makes sure your drivers won’t need to make tight turns that could be risky. You can also adjust the turn angles, but be careful—if you make the range too narrow, the system might not find any valid routes.

Example Scenario

Let’s say you want to plan a route that avoids highways and sharp turns. You’d set it up like this:

avoid=highway|sharp_turn

This will make sure your route avoids highways and sharp turns based on the default angle range. If you want to customize the turn angles, you can also add:

turn_angle_range=30

This would allow turns that are more than 30° but less than 330°.

The avoid feature is all about flexibility. Whether you want to skip tolls, stay off highways, avoid tricky turns, or even bypass certain areas altogether, this feature gives you the tools to create routes that suit your specific needs.

How do you Implement the Avoid Feature with NextBillion.ai?

NextBillion.ai provides the ‘avoid’ feature across several of its products, including the Directions API, Distance Matrix API, and Route Optimization API. You can select the API that best suits your needs based on the type of routing you’re optimizing.

For this section, let’s focus on the Directions API and walk through a scenario where you need to find the safest and most efficient route for large trucks, avoiding risky turns. Here’s a step-by-step guide to implementing this feature in your routing.

Step 1: Define Your Starting Point and Destination


Start by specifying the origin (where your trip begins) and destination (where the trip ends). These are the coordinates of your trip’s start and end locations. For example:


origin=32.75429821,-117.14624719
destination=32.75456089,-117.14694495

Step 2: Set the Mode to ‘Truck’


Since we’re optimizing for a large vehicle like a truck, you’ll need to set the mode to truck. This ensures the routing engine provides routes suitable for larger vehicles, avoiding narrow or inappropriate roads. Example:


mode=truck

Refer to Trucking solutions to learn more about truck-optimized routes.

Step 3: Configure the Avoid Feature


Next, decide what you want to
‘avoid’. In this example, we want to avoid sharp turns because they are difficult for large trucks to handle. Set the avoid parameter to ‘sharp_turn’:


avoid=sharp_turn

Step 4: Customize the Turn Angle Range


The
turn_angle_range parameter allows you to specify what turn angles are safe for your vehicle. For a truck, let’s set the range to 110 degrees, meaning the truck will only be directed to take turns between 110° and 250°. To set this:


turn_angle_range=110

This range ensures the truck won’t have to navigate tight or risky turns, making the route safer and smoother for the driver.

Step 5: Set the Route Type to Flexible


Finally, set the route type option to flexible. This ensures that the routing engine looks for the best possible route within the given constraints:


option=flexible

Step 6: Send the API Request


Once you have all the parameters in place, you’re ready to make the request. Here’s how the complete API request looks:


curl --location 'https://api.nextbillion.io/directions/json?origin=32.75429821,-117.14624719&destination=32.75456089,-117.14694495&mode=truck&key=&avoid=sharp_turn&option=flexible&turn_angle_range=110' \
--header 'Content-Type: application/json'


Step 7: Review the Response


After sending the request, you’ll receive a response containing the optimized route. The response includes details like:

Route geometry: The series of coordinates representing the path.

Distance: The total distance of the trip.

Duration: How long the route will take.

Steps: A breakdown of each part of the trip, showing the route segments between turns.

Here’s a snippet of the response:


{
   "status": "Ok",
   "routes": [
       {
           "geometry": "ki|fEbc_jUU?c@???]AI?Q?w@AO?K?w@EC?A@C@??OF??[A??c@Ae@?C?w@?Y???Q?O???[?e@?Q?@_@?_@???S?IAk@??BmBdB?dDB@?fB???@hA?R?L??@z@@LBz@??@H?@??@F?@BJ@@BHFHHLvBdA??",
           "distance": 879.89,
           "duration": 149.33,
           "start_location": {
               "latitude": 32.7543,
               "longitude": -117.14626
           },
           "end_location": {
               "latitude": 32.75454,
               "longitude": -117.14694
           },
           "legs": [
               {
                   "distance": {
                       "value": 879
                   },
                   "duration": {
                       "value": 149
                   },
                   "start_location": {
                       "latitude": 32.7543,
                       "longitude": -117.14626
                   },
                   "end_location": {
                       "latitude": 32.75454,
                       "longitude": -117.14694
                   },
                   "steps": [
                       {
                           "geometry": "ki|fEbc_jUU?c@???",
                           "start_location": {
                               "latitude": 32.7543,
                               "longitude": -117.14626
                           },
                           "end_location": {
                               "latitude": 32.75459,
                               "longitude": -117.14626
                           },
                           "distance": {
                               "value": 31
                           },
                           "duration": {
                               "value": 4
                           }
                       },
                       {
                           "geometry": "ek|fEbc_jU]AI?Q?w@AO?K?w@EC?A@C@??OF??[A??c@Ae@?C?w@?Y???Q?O???[?e@?Q?",
                           "start_location": {
                               "latitude": 32.75459,
                               "longitude": -117.14626
                           },
                           "end_location": {
                               "latitude": 32.75723,
                               "longitude": -117.14625
                           },
                           "distance": {
                               "value": 298
                           },
                           "duration": {
                               "value": 51
                           }
                       },
                       {
                           "geometry": "w{|fE`c_jU@_@?_@???S?IAk@??BmB",
                           "start_location": {
                               "latitude": 32.75724,
                               "longitude": -117.14625
                           },
                           "end_location": {
                               "latitude": 32.75722,
                               "longitude": -117.14501
                           },
                           "distance": {
                               "value": 116
                           },
                           "duration": {
                               "value": 25
                           }
                       },
                       {
                           "geometry": "s{|fEh{~iUdB?dDB@?fB???",
                           "start_location": {
                               "latitude": 32.75721,
                               "longitude": -117.14501
                           },
                           "end_location": {
                               "latitude": 32.75534,
                               "longitude": -117.14503
                           },
                           "distance": {
                               "value": 208
                           },
                           "duration": {
                               "value": 30
                           }
                       },
                       {
                           "geometry": "}o|fEl{~iU@hA?R?L??@z@@LBz@??@H?@??@F?@BJ@@BHFHHLvBdA??",
                           "start_location": {
                               "latitude": 32.75535,
                               "longitude": -117.14503
                           },
                           "end_location": {
                               "latitude": 32.75453,
                               "longitude": -117.14694
                           },
                           "distance": {
                               "value": 226
                           },
                           "duration": {
                               "value": 37
                           }
                       },
                       {
                           "geometry": "{j|fEjg_jU??",
                           "start_location": {
                               "latitude": 32.75454,
                               "longitude": -117.14694
                           },
                           "end_location": {
                               "latitude": 32.75454,
                               "longitude": -117.14694
                           },
                           "distance": {
                               "value": 0
                           },
                           "duration": {
                               "value": 0
                           }
                       }
                   ]
               }
           ]
       }
   ]
}

Step 8: Analyze the Route


In this example, the API avoided a sharp turn at an interchange by taking a slightly longer but safer route. The
turn_angle_range setting ensured the truck only made wide, manageable turns.

Visual Representation

avoid-sharp-turns-for-a-truck (1)
If you were to plot this route on a map, you’d see that the truck avoids tight turns and takes a safer path with wider angles, making the journey smoother for a large vehicle.

By following these steps, you can use the avoid feature and the turn_angle_range parameter to customize your truck routes, ensuring safety and efficiency.

Additional Functionalities of Route Optimization APIs Avoid Parameter

The avoid parameter in Route Optimization APIs provides a range of functionalities to enhance route planning and safety. Below are some key features and how businesses can benefit from them:

avoid feature

Avoid Sharp Turn


Sharp turns can be tricky for large vehicles like trucks or buses to maneuver, leading to safety risks or increased wear and tear on the vehicle. Sharp turns are particularly dangerous in congested urban areas or narrow streets.
Avoid sharp turn

Avoiding sharp turns improves safety for drivers and reduces accident risks, especially for fleets with heavy vehicles. It also ensures smoother, more efficient routes, saving fuel and time by keeping drivers on safer roads.

 

Avoid Right Turn


Right turns can be problematic in regions where traffic flow or road design makes them unsafe or time-consuming. This is similar to UPS’s no-left-turn policy but in countries where traffic moves on the left side of the road.

Avoid right turn
By avoiding right turns, companies can improve fuel efficiency, reduce the chances of accidents, and streamline deliveries. This functionality can also help prevent getting stuck in traffic jams at busy intersections, leading to faster deliveries.

 

Avoid U-Turn


U-turns are risky, especially for larger vehicles, as they often require more space and time to complete. In some regions, U-turns are restricted or involve crossing multiple lanes of traffic.
Avoid u-turn

Avoiding U-turns reduces delays and potential collisions at intersections. For businesses operating fleets, this helps minimize route deviations and keeps deliveries running smoothly without risky turns that can result in accidents or delays.

 

Avoid Tolls, Highways or Ferries


Tolls, highways, or ferries may add unnecessary costs or delays to routes. Businesses may want to avoid toll roads to minimize expenses or avoid highways and ferries due to congestion or unavailability of specific vehicle types.
Avoid tolls, ferry and highway

By avoiding tolls, businesses can lower operational costs. Skipping highways and ferries helps in planning more predictable routes that avoid congestion or regions unsuitable for specific vehicle types. This can lead to faster delivery times and reduced overhead.

 

Avoid Service Road


Service roads are often narrow, slower, and not ideal for larger vehicles or high-speed travel. They may also lack proper infrastructure for commercial trucks, leading to increased chances of delays or accidents.

Avoid service road
Avoiding service roads ensures that deliveries take faster, more reliable routes suited for heavy vehicles. This reduces the risk of vehicle damage or delays due to unsuitable road conditions. By sticking to main roads, businesses can also improve delivery speed and ensure smoother transportation, particularly for larger fleets handling time-sensitive shipments.

Business Benefits of Implementing the Avoid Feature

The ‘avoid’ features offer several advantages to business, such as:

Business Benefits of avoid feature

Increased Efficiency and Speed


Avoiding left turns can streamline routes, reduce time spent in intersections, and prevent unnecessary delays. In cities like LA, left-turn restrictions often cause added wait times, contributing to higher ETA and cancellations for rideshare services.

 

Lower Cancellation Rates


Data from rideshare companies shows that even a small increase in ETA (e.g., 2 minutes) can lead to higher cancellation rates. By avoiding left turns, businesses can offer more predictable and reliable service, improving customer satisfaction.

 

Safety and Trust


With fewer left turns, your drivers are exposed to less risk, leading to safer operations. This not only protects your workforce but builds trust with customers who rely on fast, reliable, and safe deliveries.

Plan Safer, Efficient and Cost-Effective Routes with NextBillion.ai

UPS’s no-left-turn policy has proven the value of optimizing delivery routes, saving millions in fuel costs, improving safety, and reducing environmental impact. With NextBillion.ai, your company can achieve similar results without the hefty investment. The API’s avoid feature allows you to customize your routes to avoid left turns and other hazards with ease.

Join the Private Beta: We’re announcing the private beta for our new avoid left/right turn feature and other advanced route customization capabilities. Reach out to us to learn more about how NextBillion.ai can help you optimize your logistics operations for a fraction of the cost.

About Author

Shivangi Singh

Shivangi is a seasoned Technical Writer with a passion for simplifying technical concepts. With over 5 years of experience, she specializes in crafting clear and concise documentation for various technical products and platforms.

Ready to get started?

Table of Contents