A private project, built for fun
Every bus, tram, metro, train and ferry in the Helsinki region broadcasts where it is. This site collects that, stores it, and works out how punctual each line really is.
Scroll↓
1 · The vehicle
On the road it reports its position, speed and predicted arrival at every remaining stop. HSL publishes all of it openly, as GTFS-RT feeds that anyone may read.
2 · The data
A small Python collector polls the feeds every 20 seconds, matches each running trip against the printed timetable, and works out the delay as predicted minus scheduled. HSL's feed carries no delay figure, so this is computed here.
3 · The project
The result is two views: a live map of everything moving right now, and analytics built from history the collector gathers day after day.
No framework, no build step, no paid service. Everything below runs on a single small server.
Reads the GTFS-RT protobuf feeds, matches trips to the timetable and writes the delays. Runs as its own container, restarted automatically.
Serves the pages and a small read-only JSON API. It never writes to the database, so a bug here cannot damage the history.
MapLibre GL draws the vehicles on a dark vector map. Everything else, including this page's scroll animation, is plain JavaScript.
One file holds the timetable, the live snapshot and the permanent per-trip history. Write-ahead logging lets the site read while the collector writes.
Collector, timetable loader and web app, from one image, sharing one volume.
Reverse proxy and automatic HTTPS, shared with the other sites on the same machine.
Read from HSL. Three real-time feeds and one timetable package, all open data under CC BY 4.0, no key required. Vehicle positions update every second and trip updates every 15 seconds; this site samples them every 20 seconds, which is plenty for delay statistics and keeps the load light.
The browser asks for vehicles every 10 seconds and holds no connection open, so the server stays cheap to run and the page recovers by itself after a dropout.
Analytics need this patience. A weekday pattern needs weeks, and a seasonal one needs months, so the charts get more interesting the longer the collector runs.
This is a personal side project, made out of curiosity rather than for anyone's business. It is not affiliated with HSL. Transport data © HSL, used under CC BY 4.0. Map data © OpenStreetMap contributors.