
Getting from point A to point B sounds simple enough. Pull out of your driveway, turn left, turn right, turn left…(1) Yet as many a traveling salesperson has taught us, finding the best route is not a simple task. When you add in multiple competing factors, evaluating the cost of the route and determining the “best” path is not an easy task. Today we are going to take the first step in getting those routes by extracting map data.
Map data: What do we care about?

For any given route(2) what data do we care about and how do we characterize it? The primary categories are physical data (distance, elevation) and road characteristics (speed limits, stop signs, turns). Additional data such as traffic patterns will be modeled in a future human factors post.
Characteristic | Measurement | Notes |
Distance | Linear distance of each segment | Does not include lane changes or turning radius |
Elevation | Running elevation at each point in the route | Can also be expressed as the slope at each point |
Speed limit | Posted speed limit | The actual average speed will be determined in later stages |
Traffic lights | What is the periodicity of the lights and the red/green ratio | Timing of the lights can have a dramatic effect on MPG |
Turns | Right and left turns | Turning slows down the vehicle and impacts MPG. |
Example routes
To start this off I use my first professional commute from Farmington Hills, MI to Warren, MI at the General Motors Technical Center.(3) This is primarily a highway drive and because of that, easiest to get data on. So how are we going to get this data?

MAP APIs

There are multiple options for downloading map data. Depending on your objective the source could be(4)
- USGS: A United States Government service that contains a wealth of information
- Open Streets: An open-source map source
- Google Maps: Comes with a MATLAB friendly API(5)
Getting the data from the Google Maps API requires three queries:
- Distances: Translating Lat and Lon into meters or miles
- Elevations: Those ups and downs
- Roads: Used to get both the speed limits and the signage
From tables to algorithms
For my starting point I used a static query, e.g. I downloaded the full route in one batch. The result is a 10,000+ entry point table set at 2-meter resolution.(6)
LAT | Long | delta X (meters) | elev (meters) | speed (mps) | Ahead |
42.4758 | -83.4136 | 0 | 262.128 | 6.7056 | 0 |
42.4759 | -83.4127 | 2 | 262.128 | 6.7056 | 0 |
42.4760 | -83.4121 | 2.1 | 262.130 | 6.7056 | 0 |
What is “Ahead”?
For my eventual model I added in a category of “ahead.” Ahead is calculated based on the position of a stop sign or turn, the posted speed limit, and a human factor of “driver aggression.” For safe drivers the “Ahead” will toggle early, leading to a reasonable deceleration.
More routes different data
Several years later, my wife and I moved to Ann Arbor, MI, a small college town (home of the University of Michigan). During our Ann Arbor days, I had 2 commutes; first, an “in-town” route to ADI (Applied Dynamics International), the other a mix of highway and surface streets to Ford Research. The in-town transit will be of interest for the high number of “starts and stops” while the highway commute to Ford Research, where I worked on full vehicle simulations to predict fuel economy, will act as a validation point of the earlier GM commute.


Next post
In the next post I will build up the physics model and then run it in a traffic free version of these maps.
Footnotes
- When my wife and I lived in the Boston area we joked that directions between any two points could be given just by referencing Dunkin Donuts. E.g. turn right at the first DD, turn left at the 3rd DD on your left; this was not far from the truth.
- We will cover multiple routes in a future post.
- I worked on my first full vehicle simulation H.I.L. system for GM on a project known as SimuCar. This is also the time period when I met my wife, Deborah, a great start to a wonderful life.
- This post is centered around the US; there are other download sites for the rest of the world.
- I selected Google Maps due to familiarity with the API; the others listed could be used with equal success. For other examples, these demos will give you a good start.
- I selected 2 meters resolution for processing speed, based on a 1/2 car length estimate. In later posts I will examine how the map resolution effects the MPG estimates.
One thought on “Everyday engineering: MBD & MPG (Part 2: Routes)”