Skip to main content

New Feature - GTFS timetables as CSV

· One min read

GTFS-to-HTML Version 2.3.0 adds support for exporting timetables as CSV. Setting the outputFormat configuration to csv will generate CSV files instead of HTML. One CSV file per timetable will be generated.

An example of a CSV timetable:

,San Francisco Ferry Building,Vallejo Ferry Terminal,Mare Island Ferry Terminal
Run #1,10:30am,11:30am,
Run #2,11:30am,12:30pm,
Run #3,1:50pm,2:50pm,
Run #4,2:50pm,3:50pm,
Run #5,4:10pm,5:10pm,5:25pm
Run #6,5:10pm,6:10pm,6:25pm
Run #7,6:30pm,7:30pm,
Run #8,8:50pm,9:50pm,10:05pm

Timetables in CSV respect the orientation set in timetables.txt or defaultOrientation in config.json, they can be either horizontal or vertical.

Version 1.0.0

· 2 min read

Nine years after first publishing node-gtfs, GTFS-to-HTML is ready for version 1.0.

Version 1.0 of GTFS-to-HTML switches away from using MongoDB to using SQLite3 for the underlying database. It uses Version 2.0 of node-gtfs, which made a similar switch in database used.

SQLite makes it easier to query GTFS data in SQL format if needed instead of using the built-in query methods. See this query as a example of selecting calendar dates while excluding specific service_ids.

The switch to SQLite also resulted in a 66% reduction in HTML generation times.

The breaking changes in GTFS-to-HTML 1.0.0:

  • config.json accepts a sqlitePath instead of a mongoUrl.
  • route_color and route_text_color in exported geoJSON now have a # prepended to the hex color. So #45AA00 instead of 45AA00.
  • The dataExpireAfterSeconds config option has been removed.
  • The default view pug template in views/default has some small improvements. If you are using your own custom template, you may want to include some of these.

GTFS-to-GeoJSON and GTFS-to-Chart both have similar breaking changes.

If you are using node-gtfs in your own project, all query methods have breaking changes in version 2.0.0 - see the documentation.

Please send feedback on issues you encounter or ideas for improvement by opening a Github issue. Pull requests are welcome.