Last active
November 8, 2020 14:59
-
-
Save dsamojlenko/4463143 to your computer and use it in GitHub Desktop.
Import GTFS data to MongoDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoimport --db <dbname> --collection agencies --type csv --headerline --file agency.txt | |
mongoimport --db <dbname> --collection calendardates --type csv --headerline --file calendar_dates.txt | |
mongoimport --db <dbname> --collection calendars --type csv --headerline --file calendar.txt | |
mongoimport --db <dbname> --collection routes --type csv --headerline --file routes.txt | |
mongoimport --db <dbname> --collection stoptimes --type csv --headerline --file stop_times.txt | |
mongoimport --db <dbname> --collection stops --type csv --headerline --file stops.txt | |
mongoimport --db <dbname> --collection trips --type csv --headerline --file trips.txt |
Author
dsamojlenko
commented
Jan 7, 2013
- to be entered in shell (assuming you have mongodb installed and your PATH setup correctly)
- I only did this for a subset of the GTFS files because these are the only ones I needed - you can easily add the rest of the files the same way
- I pluralized the collection names because that's how I needed them for my ORM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment