Inspiration
The annoyance of potholes in the road on our 4-hour drive down to Champagne made us curious...what if Google Maps could route us through a gentler path that avoids potholes? This got us thinking: what other convenient statistics about roads or paths could improve everyday lives?
What it does
Our project boasts three main features. The first is the pothole avoidance option: Google Maps will automatically return the route with the fewest potholes from the beginning to the end of your journey. The second is for those who are more athletically inclined: given biking routes, Google Maps can return the path with the highest cumulative elevation gain. More upwards peddling -- great for exercise! Finally, for encouraging environmentalism, we have a route that takes as many right turns as possible in lieu of a left turn. It has been proved that taking right turns is more fuel-efficient in cities than idling the engine waiting for a left (and, in fact, is used by UPS as a business practice).
How we built it
With data of course! The government of Chicago has provided large quantities of data about the city streets (and those that dwell within them) that make these analyses possible. At its core, cross-referencing data with the routes returned by the Google Maps API allowed us to tailor routes to suit the wants and needs of citizens.
Challenges we ran into
For the pothole calculations especially, individual streets each had to be considered. But just because a car travels down a street, it does not necessarily mean that they traveled the entire length of the street. Simply adding the number of potholes across streets traveled is not accurate! We had to ensure that potholes would only be counted towards a route's total if the user actually passed over them.
We ended up calculating, for each individual street the car travels upon, where the car's location starts and ends. Taking the average of that, we calculated a circle with the start and end points included in the circumference. We counted only potholes within the range of this circle, so that no extras would be included.
Other issues included the string matching of the streets provided by the Google Maps API and the data provided by the city of Chicago. Some streets referred to the same street, but had different names ("W Wacker Dr and S Wacker Dr). We used a string matching method called the Jaccard index to calculate similarity scores to ensure the correct streets matched up.
Or largest issue was with asynchronous programming in JavaScript, source of endless frustration for developers.
Log in or sign up for Devpost to join the conversation.