Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derhuerst/generate-db-graph
Generate a JSON graph of Deutsch Bahn public transport.
https://github.com/derhuerst/generate-db-graph
db deutsche-bahn graph jgf json
Last synced: 6 days ago
JSON representation
Generate a JSON graph of Deutsch Bahn public transport.
- Host: GitHub
- URL: https://github.com/derhuerst/generate-db-graph
- Owner: derhuerst
- License: isc
- Created: 2017-07-24T12:48:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-19T04:04:07.000Z (almost 3 years ago)
- Last Synced: 2024-10-03T23:54:44.097Z (about 1 month ago)
- Topics: db, deutsche-bahn, graph, jgf, json
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# generate-db-graph
**Generate a [JSON graph](http://jsongraphformat.info) of Deutsch Bahn public transport.**
[![npm version](https://img.shields.io/npm/v/generate-db-graph.svg)](https://www.npmjs.com/package/generate-db-graph)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/generate-db-graph.svg)
[![chat on gitter](https://badges.gitter.im/derhuerst.svg)](https://gitter.im/derhuerst)## Installing
```shell
npm install -g generate-db-graph
# or with ad-hoc install
npx generate-db-graph
```## Usage
```
Usage:
generate-db-graph
Examples:
generate-db-graph 8011102 # start at Berlin Gesundbrunnen
```This tool generates data in the [JSON Graph Format](https://github.com/jsongraph/json-graph-specification/blob/master/README.rst#json-graph-specification). Note that instead of storing all nodes and edges in one JSON file, **it will create `nodes.ndjson` and `edges.ndjson`. These are [ndjson](http://ndjson.org)-encoded lists of all nodes and edges**, respectively.
A node from `nodes.ndjson` looks like this:
```json
{
"id": "8013487",
"label": "Oranienburg",
"metadata": {
"latitude": 52.754697,
"longitude": 13.249084
}
}
```An edge from `edges.ndjson` looks like this:
```json
{
"source": "8081722",
"target": "8013487",
"relation": "suburban",
"metadata": {
"line": "S 1",
"time": 180000
}
}
```## Contributing
If you **have a question**, **found a bug** or want to **propose a feature**, have a look at [the issues page](https://github.com/derhuerst/generate-db-graph/issues).