ScheduleViewer (of google/transitfeed) fix + on-web deploy

148 views
Skip to first unread message

Nikhil VJ

unread,
Mar 5, 2019, 1:32:42 PM3/5/19
to Transit Developers
Hi,

This is for people using the GTFS ScheduleViewer to visualize their GTFS feeds, (https://github.com/google/transitfeed/wiki/ScheduleViewer)

Recently the map view stopped working : console log said the google maps api key being used has expired.

The wiki page says we can supply in our own key, but I discovered with this stoppage that actually the program was using some other key hard-coded into its gtfsscheduleviewer/files/index.html file. (And we've all been using someone else's key this entire time!) So I edited that, put in my key, and the program works again now.



It's an awesome tool, by the way. Kudos to the makers. Totally due for a design overhaul, but functionally it's the quickest way I'm able to show my colleagues what our feed actually contains. The Marey graph used is incredibly useful - the code is all there, hope to hack and reuse it someday.

-------------

For those wanting to deploy this tool on the web from a cloud based server, I'll share how I do it on my DigitalOcean server - I've put this in my crontab so it loads automatically on restart:

nohup python /root/hmrl-scheduleviewer/schedule_viewer.py --port 5090 /root/Pune.zip >> /root/scheduleviewer.log &

(change your folder paths appropriately)

Then it's up and running on http://<my server url>:5090/
I use different port numbers to spin up different feeds.

Oh and if the server's set up with a standard firewall etc then we have to:
sudo ufw allow 5090
..to allow visitors to access at that port num.

I had tried deploying it at a more human-readable subfolder-like path, but the program failed then because it didn't have relative paths for the embedded images etc - needed everything at top.

With a little work, one can deploy it on a free herokuapp.com account as well. If someone needs more details for that then let me know.


Regards
Nikhil VJ
Pune, India

Tom Brown

unread,
Mar 6, 2019, 9:31:51 PM3/6/19
to transit-d...@googlegroups.com
Ha, I thought it was put out to the pasture years ago. Thank you for the kind words for the contributors. I wrote a lot of it in 2007 and since then various people have added some features and kept it mostly working (https://github.com/google/transitfeed/commits/master/gtfsscheduleviewer). Hats off to Google Maps for supporting a JS API in any form for so long. I only ever ran it listening to 127.0.0.1 and encourage you to do the same.

Recently I've been turning to transitfeeds.com (for exploring details of a GTFS file) and transit.land (https://mobility-explorer.interline.io is really nice) though I get that these are limited to published data, at least for today ;-)




--
You received this message because you are subscribed to the Google Groups "Transit Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to transit-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages