Website that displays traffic data of Flanders almost in real time.
The government of Belgium has real-time data about the traffic in Flanders. In this project, I built a website that visualizes the speed of the cars.
The data is available from these URL's:
- raw data: http://miv.opendata.belfla.be/miv/verkeersdata
- some explanation: http://miv.opendata.belfla.be/miv-verkeersdata.xsd
- more explanation: http://miv.opendata.belfla.be/miv-config.xsd
- location data: http://miv.opendata.belfla.be/miv/configuratie/xml
The project consists of a nodejs API, some static front end files and a scraping script.
The setup is a bit tedious.
cd backend/scraper
virtualenv venv
source venv/bin/activate
pip install -r requirements.py
Now you can run python data_updater.py
to scrape the website. The generated json file will be saved in the folder old_data
with its timestamp as a name and will overwrite the file most_recent_data.json
.
First change the url to the API's url using the variable api_url
. Now we need to build everything. Then we need to copy the files to the public folder of our backend.
cd frontend
npm install
webpack -p
mkdir ../backend/public
cp dist/* ../backend/public
First change the config.js
file. After that it is relatively simple.
cd backend
npm install
npm start
- 0.0.1
- Work in progress
Distributed under the MIT license. See LICENSE
for more information.
https://github.com/trirpi/traffic-visualization
- Fork it (https://github.com/yourname/traffic-visualization/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request