Automated Fleet Routing Using the Bing Maps API

Nov 10, 2023

Integrating a mapping application like Bing Maps into customized ERP systems is now available by leveraging the API.

If you’ve ever searched for the nearest Thai restaurant with Google Maps or Bing Maps, you know how to click “Add Stop to Route. ” As you pull off the interstate, you are using the same routing technology that streamlines countless deliveries – from Door Dash to Uber.

Fleet routing from your college days

Today, when your college kid drives their roommates home for Thanksgiving, they can input all four addresses into their phone and find the perfect zigzag route to their homes.

It gets more complicated if you’re managing a ride board and have six drivers heading to the metro area. If 2 SUVs, 2 Camrys, a Ford F150, and a Mini Cooper sign up, how do you slot 22 kids, some with backpacks, most with carry-on bags, and three with steamer trunks? Should you throw the steamer trunks into the pickup even if those three kids live on opposite ends of the city? Should you divide the metro area into regions and fill each car with bags until each trunk is full?

Automated fleet routing for Cutting Edge Firewood

Cutting Edge Firewood faced a similar challenge delivering racks of firewood to high-end customers and pizza oven restaurants throughout the Atlanta metro region. Cutting Edge was comfortable using Bing, Google Maps, and Portatour® for route planning, but these apps could not handle fleets – similar to the Rubik’s challenge with the ride board.

An integrated routing solution

TwinEngines designed an integrated solution that harnesses the routing technology of Bing Maps while optimizing the real-world delivery challenge of a fleet of trucks, with different regions, truck capacities, and quantities of wood.

The requirements were simple:

  • Determine which truck should take a given order
  • Determine the best delivery route for each truck
  • Work within the parameters of truck capacity, customer working hours, and driver shifts

The Power of the Bing Maps API

TwinEngines chose Bing Maps for the routing engine. Its favorable per-address pricing structure worked best for enterprise licensing. The Bing Maps API gave TwinEngines’ developers access to a mapping platform equipped with geolocation, routing, reporting and analytics, intelligent mapping, and a host of developer tools.

Calculating time for fleets

A mapping app tells you the time and distance between two points, but it doesn’t tell you which truck should make the delivery.

The solution was to develop a software routine that places a given order on each truck and calculates the additional time accrued. For example, placing the order on:

  • Truck A adds 35 minutes
  • Truck B adds 15 minutes
  • Truck C adds 7 minutes

Truck C is the most efficient truck route to take the order, but it may not have room if Truck C is nearing its capacity of 25 racks of wood. The best truck is B.

Automated fleet routing – How it works

The fleet routing app works with delivery addresses, order sizes, and special instructions imported from sales orders into a Web-based portal application. Cutting Edge Firewood uses SalesForce to manage its orders, but any ERP would work.

TwinEngines created the custom portal app from Microsoft Visual Studio, C#, and .Net. Cutting Edge named their app “Vulcan” after the god of fire.

The Bing Maps API powers this custom solution by performing route calculations and mapping in the background. The front-end portal sends all the addresses to be considered to Bing Maps, which returns a sorted list for the most efficient route.

Each successive stop adds more time to the trip, illustrated with Trucks A, B, and C above. The calculation determines the optimum truck route to use.

Realtime display

The front-end portal displays a list view showing each stop and the delivery and timing details. The Bing Maps route view is displayed alongside the list view.

If one of the stops is for a wood-fired pizza restaurant that opens at 10:00 am, the application factors this delivery restriction. Color coding highlights the impact of adding stops and loads to each truck.

The real-time display integrates Bing Maps (left) with a custom front-end portal connected by the API. (click to enlarge)

Manual interaction

Dragging and dropping the table rows sends the changed sequence back to Bing Maps through the API. The changed route is updated on the map.

Full integration with custom mobile app.

Mobile App

A custom mobile app gives a handheld version of the route to the drivers on the truck.

Seed points – The hidden starting points

The solution optimizes the route as each successive order is added to a truck, but where do you begin? With seven empty trucks, which truck do you choose for the first order?

The solution was to designate geographic areas, for example, Downtown, Northern Suburbs, and the Airport Area. Each area is defined by seed points – fictitious delivery addresses that define the area’s borders.

When Bing Maps chooses a truck, it thinks the truck is going to one of those seed point locations. Once the route begins to take shape with actual orders, the seed points are dropped.

Bing Maps APIs

Here are the APIs used in the application.

Mapping: Bing Maps V8 Web Control

We used an API control panel that displayed the route time and all the turning points. We also received similar data from the routing API.

From the Routing results, we set the order in which the addresses are set in the map to get an ordered list of waypoints. We send that data into the map control so it can display that same order into the map.

 

Routing: Bing Maps REST Services.

This API optimized directions for the route, but it can also get directions without optimization, travel times (with and without traffic), Lat/Long coordinates from an address, and pass both Lat/Long coordinates and an address into the same API URL.

We could also enter truck data like Width, Length, Max Gradient, and Turn Radius to confirm that the trucks would be able to manage tight passages.

 

Leveraging the power of Bing Maps APIs

Major vendors include APIs that let developers to interact securely with their applications. Before the API era, developers needed to access the database without business rules to manage the data exchange or the structure for developers to know what they’re looking at.

With an API, developers communicate through a well-defined API service that expects specific parameters to return documented results.

Integrating a mapping application like Bing Maps into customized ERP systems is now manageable. In this case, TwinEngines could pull data from SalesForce using its API and then send the requests to Bing Maps to perform mapping, scheduling, and route optimization for a fleet of trucks.

 

Manual interaction

Dragging and dropping the table rows sends the changed sequence back to Bing Maps through the API. The changed route is updated on the map.

Full integration with custom mobile app.

Mobile App

A custom mobile app gives a handheld version of the route to the drivers on the truck.

Seed points – The hidden starting points

The solution optimizes the route as each successive order is added to a truck, but where do you begin? With seven empty trucks, which truck do you choose for the first order?

The solution was to designate geographic areas, for example, Downtown, Northern Suburbs, and the Airport Area. Each area is defined by seed points – fictitious delivery addresses that define the area’s borders.

When Bing Maps chooses a truck, it thinks the truck is going to one of those seed point locations. Once the route begins to take shape with actual orders, the seed points are dropped.

Bing Maps APIs

Here are the APIs used in the application.

Mapping: Bing Maps V8 Web Control

We used an API control panel that displayed the route time and all the turning points. We also received similar data from the routing API.

From the Routing results, we set the order in which the addresses are set in the map to get an ordered list of waypoints. We send that data into the map control so it can display that same order into the map.

 

Routing: Bing Maps REST Services.

This API optimized directions for the route, but it can also get directions without optimization, travel times (with and without traffic), Lat/Long coordinates from an address, and pass both Lat/Long coordinates and an address into the same API URL.

We could also enter truck data like Width, Length, Max Gradient, and Turn Radius to confirm that the trucks would be able to manage tight passages.

 

Leveraging the power of Bing Maps APIs

Major vendors include APIs that let developers to interact securely with their applications. Before the API era, developers needed to access the database without business rules to manage the data exchange or the structure for developers to know what they’re looking at.

With an API, developers communicate through a well-defined API service that expects specific parameters to return documented results.

Integrating a mapping application like Bing Maps into customized ERP systems is now manageable. In this case, TwinEngines could pull data from SalesForce using its API and then send the requests to Bing Maps to perform mapping, scheduling, and route optimization for a fleet of trucks.

 

 

 

Before the API era, developers needed to access the database without business rules to manage the data exchange. 

Major vendors now include APIs that let developers interact securely with their applications.

Q

Discuss your operational goals with a business process technology consultant

TwinEngines, Inc.
154 Krog Street NE, Suite 140
Atlanta, GA 30307
Phone: 404.522.4262
Email: info@twinengines.com