Real Time Traffic Monitoring & Analysis

Electronics Enthusiast

Introduction

People cannot live without vehicles. Going to work, going to and off school, visiting different places, and so on. However, as we see nowadays, as more vehicles are been produced and get onto roads, traffic on the road is getting worse and worse day by day. The impact of traffic jam will obviously be noticeably amplified if you are living in a big city in China. In China, cities have a much higher population density, with a lot of cars crowded in a relatively small area. The way people drive daily is different from that in California – instead of speeding up on freeways, many people need to get into the slowly moving traffic, every working days. The situation is getting worse with a rapidly growing number of cars people own, which increased 10 times in the past decade. The traffic condition throughout a day changes drastically, base on different reasons – driving to work, picking up kids, weather, etc.

In this project, I had a Python script running on a server that’s collecting real-time traffic information from four representative locations using AMaps API, starting 2018, and switched into BaiduMaps API in 2021 due to deprecation of AMaps API. (AMap and BaiduMap are among the largest map providers in China, like Google Maps in the US)

The results are saved into a database for later analysis use, and also published to thingspeak for a direct visualization in real time.

Analysis

Jupyter Notebook Hosted on Github