ivandorte
Rome-in-transit
Python

This dashboard displays the near real-time position of any bus, tram, or train (ATAC and Roma TPL operators) within the Metropolitan City of Rome Capital.

Last updated Aug 30, 2025
17
Stars
1
Forks
0
Issues
0
Stars/day
Attention Score
3
Language breakdown
No language data available.
Files click to expand
README

:trolleybus: Rome in Transit (GTFS-RT)

img

License: CC BY-SA 4.0

Description

This dashboard displays the near real-time position of any bus, tram, or train (ATAC and Roma TPL operators) within the Metropolitan City of Rome Capital. The stream layers automatically updates every 10 seconds through a periodic callback with new data retrieved from the GTFS-RealTime (Overview) feed provided and mantained by Roma Mobilità (website)

Hugging Face: https://huggingface.co/spaces/ivn888/Rome-in-transit

GitHub Pages: https://ivandorte.github.io/Rome-in-transit/gtfs-rt/app.html

Components

Two stream layers (maps):

  • The "Vehicle status" map shows, as the name implies, the current status of the vehicle:
- $\textcolor{#0077BB}{\rm \textbf{In\ transit}}$ - $\textcolor{#EE7733}{\rm \textbf{Stopped}}$
  • The "Delays map" displays whether a vehicle is on time (ahead + on time) or behind schedule (late)
  • :
- $\textcolor{#009988}{\rm \textbf{On\ time}}$ - $\textcolor{#CC3311}{\rm \textbf{Late}}$

N.B.: The value of the delay field (in minutes) will be zero if the vehicle is on time (A), negative if ahead of schedule (B) or positive if late (C).

img

Five number indicators showing:

  • The number of currently active vehicles (fleet) divided between in transit or stopped;
  • The number of vehicles on time or behind schedule;

Data

ToDo

  • [ ] Add alerts feed;
  • [ ] Add routes, stops, etc...;

Known problems:

  • If you view a blank page in HF restart the Space;
  • The periodic callback may suddenly stop working (I don't know why) and the data will not be updated, simply refresh the application page;

Deployment on GitHub pages

  • Loaded my custom Python modules from GitHub:
https://github.com/ivandorte/Rome-in-transit/blob/52a790cecf2663c0289b3e54664a57c1ba3985c1/docs/gtfs-rt/app.js#L42-L52
  • Loaded protobuf and gtfs-realtime-bindings wheels from a CDN URL:
- protobuf is available on pypi: https://pypi.org/project/protobuf/#files

- gtfs-realtime-bindings (https://pypi.org/project/gtfs-realtime-bindings/#files) was compiled via: python setup.py bdist_wheel

  • How I partially solved the CORS problem?
- Used corsproxy.io to bypass CORS errors on HTTP requests;

- Used XMLHttpRequest (js) to make HTTP requests of binary data;

https://github.com/ivandorte/Rome-in-transit/blob/52a790cecf2663c0289b3e54664a57c1ba3985c1/modulespyodide/romegtfs_rt.py#L51-L66

Deployment on HF

Just read this Medium article written by Sophia Yang, Ph.D.

References

Authors

  • Ivan D'Ortenzio
Twitter

LinkedIn

🔗 More in this category

© 2026 GitRepoTrend · ivandorte/Rome-in-transit · Updated daily from GitHub