gtfs-to-leveldb

1.0.0 • Public • Published

gtfs-to-leveldb

Import GTFS data into a LevelDB.

Currently, the following GTFS files are supported:

  • agency.txt required
  • stops.txt required
  • routes.txt required
  • trips.txt required
  • stop_times.txt required
  • calendar.txt optional, required if calendar_dates.txt is not provided
  • calendar_dates.txt optional, required if calendar.txt is not provided
  • shapes.txt optional

npm version license chat on gitter

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.

Package Sidebar

Install

npm i gtfs-to-leveldb

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

10.7 kB

Total Files

11

Last publish

Collaborators

  • derhuerst