This project analyzes traffic density and queue lengths at rural, urban, and metro intersections using SUMO (Simulation of Urban Mobility) and OpenStreetMap (OSM). The goal is to identify traffic congestion patterns and optimize signal control for improved flow and reduced delays.
- Extract real-world intersection layouts from OpenStreetMap for accurate traffic modeling.
- Simulate traffic density and vehicle flow using SUMO.
- Analyze queue lengths to optimize signal timing and congestion management.
- SUMO: Traffic simulation software
- OpenStreetMap (OSM): Real-world road network data
- Python (for automation)
- Rural Area: Court Square, Betnoti
- Urban Area: Murgabadi Circle, Baripada
- Metro Area: Wellington Fountain, Kala Ghoda, Mumbai
This steps consists of importing our OSM map that will be in xml format :
1. go to OpenStreetMAP! website.
3. Use the netconvert tool to convert the osm map to a SUMO network file using the following command
netconvert --osm-files OSM_file_name.osm -o network_file_name.net.xml4. OSM-data not only contains the road network but also a wide range of additional polygons such as buildings and rivers. These polygons can be imported using POLYCONVERT and then added to a SUMO configuration file(*.sumocfg).
you can use the .poly.xml file from this repository this file contains some basic polygons description like the water, buildings ... etc
now we are ready to generate our poly.xml file by typing the following command:
polyconvert --net-file network_file_name.net.xml --osm-files OSM_file_name.osm --type-file typemap.xml -o poly_file_name.poly.xml5. At this point we have our scenario street network file, as we know we need and additional description file that describes the vehicles and their routes the file named .rou.xml
For these purpose we can youse the randomtrip tool to generate a random route scenario by typing the following command:
python {PATH TO SUMO}/tools/randomTrips.py -n network_file_name.net.xml -r route_file_name.rou.xml -e 100 -l
6. At this point we generated our routes file, and we just need one more final file to be ready to execute our simulation.
Now we should put all together in a sumo configuration file that will tell our simulator about the route and network files that we want to use in our simulation the file should look like the following:
<configuration>
<input>
<net-file value="network_file_name.net.xml"/>
<route-files value="route_file_name.rou.xml"/>
<additional-files value="poly_file_name.poly.xml"/>
</input>
<time>
<begin value="0"/>
<end value="1000"/>
<step-length value="0.1"/>
</time>
</configuration>This file should be saved with the extension *.sumocfg
sumo-gui config_file_name.sumocfgPut values like a) Delay: 20ms b) Scale Traffic: 120 c) Choose real world or standard simulation
And here are the cars mooving :D
Based on the simulations performed using SUMO for traffic analysis at three distinct areas— Rural (Court Square, Betnoti), Urban (Murgabadi Circle, Baripada), and Metro (Wellington Fountain, Kala Ghoda, Mumbai)—the following key observations were made:
The metro area exhibited the highest traffic density and queue length compared to both urban and rural areas. This indicates a significant level of congestion in metro regions, with traffic jams more prevalent due to the high volume of vehicles.
Traffic density and queue lengths in the urban area were moderate, reflecting typical city traffic conditions, though not as severe as the metro area. These areas experience moderate congestion, often during peak hours.
As expected, the rural area showed the least traffic density and queue length, with smoother traffic flow and fewer delays.
The higher congestion in the metro area suggests a greater need for traffic optimization strategies, such as adaptive signal control or alternative routing to improve traffic flow and reduce delays. Urban areas may also benefit from such optimizations, albeit to a lesser extent.
This project demonstrates how SUMO and OpenStreetMap can be used to analyze and optimize traffic flow at different intersection types. Future work can explore AI-based traffic light optimization to reduce congestion further.
🚀 Contributions Welcome! Feel free to fork this repo and improve the simulation!
📩 For queries, contact: pratyushpanda530@gmail.com
