Inspiration
The inspiration for Traffic Navigator came from the daily struggles of urban commuters facing unpredictable traffic conditions. We recognized that while various mapping services exist, there was a need for a more intelligent, data-driven approach to route optimization that considers real-time factors like weather and congestion levels.
What it does
The application takes a start and end location from the user and calculates the most efficient route between them. It uses real-time traffic data and weather conditions to provide the most up-to-date and accurate route suggestions. By incorporating current weather data from the OpenWeatherMap API, the system adjusts its predictions based on environmental factors that could affect traffic flow. The optimized route is displayed on an interactive map using Folium. The map shows the start and end points, and color-codes the route based on predicted congestion levels (green for light traffic, orange for moderate, and red for heavy congestion). The system uses graph theory (via NetworkX and OSMnx) to find the shortest path while considering real-time traffic conditions, allowing for dynamic route adjustments based on current road conditions.
How we built it
Built using Flask, the application leverages the TomTom API for accurate mapping and traffic data, while the OpenWeatherMap API supplies current weather conditions to enhance route predictions. The core functionality includes predicting traffic speeds and congestion levels using machine learning models, specifically Random Forest, which are trained on historical data. Users can input their starting and destination points, and the app generates an optimized route displayed on an interactive map with color-coded congestion levels. The project also incorporates error handling and logging to ensure reliability and a smooth user experience. Overall, Traffic Navigator aims to reduce travel time and improve urban mobility for its users.
Challenges we ran into
Data Integration: Combining real-time data from multiple sources (TomTom API for traffic, OpenWeatherMap API for weather) and integrating them seamlessly into our prediction models was a significant challenge. We had to ensure that the data was properly synchronized and formatted for accurate predictions. Graph Processing for Large Areas: Using OSMnx and NetworkX to process large urban areas for routing presented performance challenges. We had to optimize our graph processing algorithms to handle extensive road networks efficiently.
What we learned
Through the development of Traffic Navigator, we gained valuable experience in integrating multiple APIs and data sources to create a comprehensive traffic optimization solution. We learned how to effectively combine real-time traffic data from TomTom with weather information from OpenWeatherMap, enhancing our route predictions.
What's next for Traffic Navigator
One potential direction is to expand the machine learning models to incorporate additional features, such as historical traffic patterns and event-based data, to further improve prediction accuracy. Integrating more advanced geospatial analysis and visualization tools could enhance the user interface, making it even more intuitive and informative.
Built With
- flask
- ngrok
- openstreetmap
- openweathermap
- python
- tomtomapi
Log in or sign up for Devpost to join the conversation.