Milano Public Transport Tracker

Milano Public Transport Tracker Used AI

10 devlogs
25h 5m
•  Ship certified

Tracks Milano, IT public transport vehicles by reverse engeneering their system to track how many minutes are left untill the vehicle arrives at the station, along with tracking the vehicle IN REAL TIME with extreme accuracy (± 5 meters)

Timeline

Added more features to the DEMO

Update attachment

Ship 1

1 payout of shell 412.0 shells

Leonardo Monforte

about 2 months ago

Leonardo Monforte Covers 9 devlogs and 23h 2m

Spent 6 hours making a DEMO version of the website as I cannot create a demo with all functionalities.

Check it out!
https://milanopt-tracker-demo.onrender.com

Update attachment

I. DID. IT!
I FIXED EVERYTHING! (Add 2 hours to the since last devlog as it has not yet updated :/)

Video below has the (almost) completed product showcase!

MilanoPT by Leonardo Monforte – Devlog N.8
🗺️ Loads & caches Milan GTFS data (routes, stops, shapes, trips)
📍 Interactive map (using Leaflet.js): all stops, clustered for clarity
👆 Click any stop: see lines & real-time wait times!
🚇🚋🚌 Track any line (Metro, Tram, Bus): draws route, shows all stations, color-coded
🕒 REAL-TIME VEHICLE TRACKING: highlights arriving stations, animates vehicle icons along the route using ONLY the very limited API offered by Milano ATM.
🧭 Vehicle icons show type & direction they are heading towards
🕹️ User controls: track line, reset map, zoom to vehicle (more to come!)
📌 See your location: When promted, allow access of your location to see your real-time location on the map!
🛡️ Robust error handling & debug logging (backend)

See video below for a showcase!

Still fixing bugs with the animation... YIKES!

Update attachment

Not much progress right now...

Just fixing the last bugs and adding a new (secret!) feature and ill be done for today I think, maybe I might post one more tonight and call it a day.

Bye bye :D

Update attachment
Leonardo Monforte Leonardo Monforte about 2 months ago
si! ti ho scritto nei DM :)
andre-cmd-rgb andre-cmd-rgb about 2 months ago
ciao, dici che è possibile farlo anche per Torino?, comunque bel progetto!!

WE GOT PROGRESS
The vehicle is now moving well on the map!
This is incredible, and I am feeling very proud of the work

See video below to see it follow the line and get to the destination!
(Still ome bugs as only one of the vehicles is moving and its waaay too fast, but I hope to fix that it near no time!)

Some updates.
Attempting to create the animation using a faster more reliable and more accurate script called leaflet.marker-motion but no sucess so far, getting 404's and 302' everywhere!
As soon as I get a fix, ill update this log.

Update attachment

BIG Progress

Today was a productive one. I finally got the transport logic working, vehicles now move smoothly from one station to the next using the wait times, just as planned. Toi make it smooth, I added a feature that allows the vehicle markers to accelerate and slow down depending oin how much time the next station is reporting.

For example:
If the upcoming station says 3 minutes then the vehicle adjust its speed to get there in 3 minutes on the map too. If the station switches suddently from 3 to 1 minute, the vehicle speeds up smoothly and slows down smoothly as well to account for the delay.

I actually went outside and tested the system for 2 hours straight myself, going on every form of public transport with my PC running the code to see if it was accurate. There are still some uncertaintes especially when ARRIVING at a station (the time says 0 minutes so I have to figure out the speed for that) the rest is super accurate! Very proud.

The system tracks their movements accurately, updating everything in real-time. I also cleaned up the database structure, making it much more efficient and easier to scale later. It’s solid now.

The METRO (M1, M2, M3, M4, M5) is still giving me trouble, some bugs are holding it back, but I’m putting that aside for now. I’ve been at this for 10 hours today, and that’s more than enough. Tomorrow, I’ll dig into the METRO issues and get that part running too. One step at a time.

Update attachment

Created custom markers for Tram, Bus, and Metro. Added their markers correctly on the map.
Attempting to make them follow the path line to approach the next station

Update attachment

Fixed Red Dots for Approaching Stations

Update attachment