Skip to content

Instantly share code, notes, and snippets.

@mheadd
Created October 8, 2011 14:10
Show Gist options
  • Select an option

  • Save mheadd/1272333 to your computer and use it in GitHub Desktop.

Select an option

Save mheadd/1272333 to your computer and use it in GitHub Desktop.
Thoughts / docs from Reed Lauber - creator of NextSepta
The NEXT-Septa project is here:
https://github.com/reedlauber/Next-Septa
Specifically, the import code is here:
https://github.com/reedlauber/Next-Septa/blob/master/lib/tasks/import_gtfs.rake
It's a ruby rake task, so if someone wanted to use it in their own Rails project, then can run it with a few optional arguments. e.g....
rake import_gtfs // imports everything (currently default to buses only)
rake import_gtfs[routes] // imports just routes
rake import_gtfs[routes, rail] // imports routes for rail lines, not buses
rake import_gtfs[routes, all] // imports routes for both buses and rail
One thing to watch out for is how long some of this can take. Most of the datasets aren't too bad, but if I remember correctly, "trips" took almost an hour and "stop_times" took several hours. Funneling it all through rails might not be the best idea. A direct import into postgres (or whatever db) would probably be a lot faster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment