https://github.com/derhuerst/vbb-line-variant-score
Identify the canonical variants of a VBB line.
https://github.com/derhuerst/vbb-line-variant-score
berlin bvg public-transport transit vbb
Last synced: 4 months ago
JSON representation
Identify the canonical variants of a VBB line.
- Host: GitHub
- URL: https://github.com/derhuerst/vbb-line-variant-score
- Owner: derhuerst
- License: isc
- Created: 2018-05-03T18:39:36.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-05T10:21:58.000Z (about 7 years ago)
- Last Synced: 2025-01-07T19:12:18.250Z (5 months ago)
- Topics: berlin, bvg, public-transport, transit, vbb
- Language: JavaScript
- Homepage: https://github.com/derhuerst/vbb-line-variant-score#vbb-line-variant-score
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# vbb-line-variant-score
**Identify the canonical variants of a VBB line.**
[](https://www.npmjs.com/package/vbb-line-variant-score)
[](https://travis-ci.org/derhuerst/vbb-line-variant-score)

[](https://gitter.im/derhuerst)
[](https://patreon.com/derhuerst)## Installing
```shell
npm install vbb-line-variant-score
```## Usage
```js
const readLines = require('vbb-lines')readLines()
.on('data', (line) => {
const computeLineVariantScore = create(line.variants)for (let variant of line.variants) {
console.log(
computeLineVariantScore(variant),
variant
)
}
})
```Most VBB lines have 1 "canonical" set of stations, hence 2 "canonical" variants. They will be the 2 variants with the highest score.
## Contributing
If you have a question or have difficulties using `vbb-line-variant-score`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/vbb-line-variant-score/issues).