ecoRoute shows the estimated fuel consumption for different driving paths between any two destinations
One of the members on our team makes a long drive nearly twice a day. Google maps provides the information needed to find the fastest route, but taking such a long drive multiple times a day is not only harsh on your wallet, but also the environment. Our team agreed that there should be a way to understand which route would be the best to take, regardless of if it took longer, as long as it used less gasoline.
What it does
EcoRoute gives the user data about fuel consumption on any given driving route. The user is allowed to choose from a selection of varying vehicles with drastically different fuel efficiencies. After selecting a starting point and an ending point, the map draws your route, and gives a pop up message as to how much fuel you will use on that route by comparing hundreds of points of elevation data. This gives the ability to compare alternate routes, and their efficiencies in order to find a route that avoids unnecessary fuel consumption. In our examples, we found that the earlier mentioned team member was able to find a route that cut over half a gallon of gas per trip! That saves hundreds of gallons a year, based off of a single use of the program!
How we built it
We began by creating a web page, and used the Google Maps API to populate the page with a map. Our next step was to understand how to input starting and ending points, and have the Google Directions API set a route for us. Next, we dove deep into the directions we received, 6 levels to be exact, and found latitude and longitude data for every little turn on the route. We used that data to ping the Google Elevation API, and receive hundreds of points of elevation data. Still further, we found the distance between each of the points, and the differences in elevation between those points. We used this information to create an array of slopes, one for each stretch of road. After getting the slopes, we sent each of them into a function based in trigonometry that uses the slope data to return a number we should multiply our fuel consumption by. After adding up all of those values, and doing a large amount of conversion, we created a marker at the beginning of the route displaying total estimated fuel consumption. It was difficult, but we got it!
Challenges we ran into
Accomplishments that we're proud of
First and foremost, we all made some great friends! We were not all familiar with one another before this hackathon, but now we know eachother very well. We are also proud that we were not just able to meet our initial goal of getting fuel consumption data, but we were finished so early that we could use the Shine API and allow users to choose from a selection of vehicles! We had a wonderful time, and we are extremely proud of the results of our hard work. Every single member of our team made significant contributions to the end product. In no way was 1 person pulling the weight, and no one was 'free loading.' We all worked extremely hard, slept very little, kept our cool, and made a product that can have a very positive impact on the well being of our planet.
What we learned
What's next for ecoRoute
Our data could still be more accurate. We want to add stop sign locations, as well as stop lights. These stops add a significant amount of fuel consumption, and would be very useful for increasing the accuracy of our fuel emission estimations. Another one of our next steps would be to add speed limit data, because the speed of a driver affects fuel emission significantly. There are plenty of other factors we could add, including a better algorithm modeling the correlation between elevation and fuel emissions. Our end goal is to use these factors to find the most fuel efficient path from one place to another. Hopefully people will begin using the most economic route for travel rather than simply the fastest. Our planet cannot handle the emissions we are currently producing, and in order to give people in the future an equal chance that we have, we must find ways to preserve this beautiful planet we live on. If everyone saved just half a gallon of gas per day, we would be cutting down fuel consumption by billions, if not trillions of gallons per year.