Lurker News
Hey all! My train the other day was delayed and I got curious where they all were at any given time, so I built a map and figured I'd share it.

Comments (302) 69 threads

Earlier comments
s9g#
Looks like the Alaska Railroad doesn't have any publicly available location data on their site - https://www.alaskarailroad.com/

Which is a shame, because I actually worked on a live train map internally when I was an intern there a decade ago.

svarlamov2 replies#
Love this project! Can you tell us a bit about what stack you used to build this? Were there easy-to-use APIs to get this data in realtime?
klinquist#
I can comment on Caltrain only, the location is available via the 511.org API.

I built a project that predicts how late trains are based on their current location vs historical averages and posts the data to Mastodon. https://caltrain.live.

zhivota#
Very nice, thanks for the write up :). I was thinking about how you could get route maps, without actually having to source shape files. Given you are tracking trains every minute, you could probably build up your own route maps by dropping a point every time you get one, and connecting them with straight lines. Over time the route would become closer and closer to reality.
mourner1 reply#
A lovely map — thanks for using Leaflet and keeping that little Ukrainian flag in the corner! Probably needs an attribution for the map added too (looks like it's Carto with an OpenStreetMap-derived basemap).
ryry#
thanks - done!

Load more comments