1.2.36 • Published 2 years ago

transportation v1.2.36

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

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     │
└───────┴────────────┴───────────────────────────────────────────────┴─────────┘

Command Line

npm install -g transportation

transportation provides a binary transportation. It supports the following commands.

Export Vehicles' Positions as GeoJSON

Prints all vehicles' positions of a specific date as GeoJSON linestrings with time components:

transportation positions /path/to/gtfs/dir

By default multiple trips are simply newline-separated GeoJSON to support streaming. If you want to return a single JSON array use the --array flag. Additional options are available via transportation positions --help. The generated GeoJSON LineString has its time property set as an array of timestamps and is therefore compatible with tools like LeafletPlayback and others.

1.2.36

2 years ago

1.2.35

3 years ago

1.2.34

3 years ago

1.2.33

3 years ago

1.2.32

4 years ago

1.2.31

4 years ago

1.2.30

5 years ago

1.2.29

5 years ago

1.2.28

5 years ago

1.2.27

5 years ago

1.2.26

5 years ago

1.2.24

5 years ago

1.2.23

5 years ago

1.2.22

5 years ago

1.2.21

5 years ago

1.2.20

6 years ago

1.2.19

6 years ago

1.2.18

6 years ago

1.2.16

7 years ago

1.2.15

7 years ago

1.2.14

7 years ago

1.2.13

8 years ago

1.2.12

8 years ago

1.2.11

8 years ago

1.2.10

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.0

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.1

9 years ago