README
gtfs-to-leveldb
Import GTFS data into a LevelDB.
Currently, the following GTFS files are supported:
agency.txt
requiredstops.txt
requiredroutes.txt
requiredtrips.txt
requiredstop_times.txt
requiredcalendar.txt
optional, required ifcalendar_dates.txt
is not providedcalendar_dates.txt
optional, required ifcalendar.txt
is not providedshapes.txt
optional
Installation
npm install gtfs-to-leveldb
Usage
From the command line
gtfs-to-leveldb <gtfs-directory> <path-to-leveldb>
Arguments:
gtfs-directory Input directory containing GTFS textfiles.
path-to-leveldb Path of the LevelDB that will be created/written to.
Options:
--help -h Show this help message.
--version -v Show the version number.
From JavaScript
const level = require('level')
const convert = require('gtfs-to-leveldb')
const db = level('my-db.ldb', {valueEncoding: 'json'})
convert('path-to-gtfs-dir', db)
.then((reader) => {
return reader.route('123') // read route with ID `123`
})
.then(console.log)
.catch(console.error)
Contributing
If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit the issues page.