db-vendo-client/p/bvg/readme.md

44 lines
1.2 KiB
Markdown
Raw Normal View History

2018-07-28 13:54:44 +02:00
# BVG profile for `hafas-client`
2018-07-28 13:43:15 +02:00
2018-07-28 13:54:44 +02:00
[*Verkehrsverbund Berlin-Brandenburg (BVG)*](https://en.wikipedia.org/wiki/Verkehrsverbund_Berlin-Brandenburg) is the major local transport provider in [Berlin](https://en.wikipedia.org/wiki/Berlin). This profile adds *BVG*-specific customizations to `hafas-client`.
2018-07-28 13:43:15 +02:00
## Usage
```js
const createClient = require('hafas-client')
2018-07-28 13:54:44 +02:00
const bvgProfile = require('hafas-client/p/bvg')
2018-07-28 13:43:15 +02:00
2018-07-28 13:54:44 +02:00
// create a client with BVG profile
const client = createClient(bvgProfile, 'my-awesome-program')
2018-07-28 13:43:15 +02:00
```
## Customisations
2018-07-28 13:54:44 +02:00
- parses *BVG*-specific products (such as *X-Bus*)
2018-10-28 16:37:19 +01:00
- supports [BerlKönig `journey` legs](#berlkoenig)
2018-07-28 13:43:15 +02:00
- strips parts from station names that are unnecessary in the Berlin context
- parses line names to give more information (e.g. "Is it an express bus?")
- renames *Ringbahn* line names to contain `⟳` and `⟲`
2018-10-28 16:37:19 +01:00
### BerlKönig
BVG has recently announced [a ride-sharing service called *BerlKönig*](https://www.berlkoenig.de). Pass `berlkoenig: true` into `journeys()` to get special legs:
```js
{
mode: 'walking',
departure: // …
arrival: // …
origin: // …
destination: // …
line: {
type: 'line',
name: 'BerlKönig',
public: true,
mode: 'taxi',
product: 'berlkoenig'
}
}
```