JSPM

  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q32141F
  • License MIT

Import GTFS into a semantic model

Package Exports

  • transportation

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (transportation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

transportation

Import GTFS data into a semantic model

Screenshot

Installation

$ npm install transportation

Usage

var Transit = require('transportation')
var transit = new Transit()

// import GTFS data
transit.importGTFS('/path/to/gtfs/dir', function (err) {
  // have a look at the Transit instance
  console.log(transit)
})

transportation provides a replacement for node's console by using tconsole, so you can inspect the objects in the node.js REPL by using require('transportation/console'):

> var konsole = require('transportation/console')
> konsole(transit)
┌────────────┬─────┐
│ Agencies   │ SWU │
├────────────┼─────┤
│ # Stops    │ 773 │
├────────────┼─────┤
│ # Services │ 14  │
├────────────┼─────┤
│ # Shapes   │ 65  │
└────────────┴─────┘
> konsole(transit.agencies.SWU.routes)
┌───────┬────────────┬───────────────────────────────────────────────┬─────────┐
│ ID    │ Short Name │ Long Name                                     │ # Trips │
├───────┼────────────┼───────────────────────────────────────────────┼─────────┤
│ 87001 │ 1          │ Söflingen–Böfingen                            │ 613     │
├───────┼────────────┼───────────────────────────────────────────────┼─────────┤
│ 87003 │ 3          │ Wiblingen (Alte Siedlung)–Wissenschaftsstadt  │ 649     │
├───────┼────────────┼───────────────────────────────────────────────┼─────────┤
│ 87004 │ 4          │ Grimmelfingen–Kuhberg–Böfingen Süd            │ 590     │
└───────┴────────────┴───────────────────────────────────────────────┴─────────┘