Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BVG BerlKönig has ended #272

Open
olof-nord opened this issue Oct 12, 2022 · 2 comments
Open

BVG BerlKönig has ended #272

olof-nord opened this issue Oct 12, 2022 · 2 comments

Comments

@olof-nord
Copy link

The BVG BerlKönig offering ended on the 20th of July 2022.

Do we need to update the BVG profile, and/or adjust the BVG profile readme?

https://prod.berliner-zeitung.de/mensch-metropole/tschuess-berlkoenig-die-letzte-tour-durch-die-berliner-nacht-steht-bevor-li.248515

@derhuerst
Copy link
Member

A PR that removes the BerlKönig-specific code would be great!

hafas-client/p/bvg/index.js

Lines 111 to 139 in 4189ce4

const parseJourneyLegWithBerlkönig = (ctx, leg, date) => {
if (leg.type === 'KISS') {
const icon = ctx.common.icons[leg.icoX]
if (icon && icon.type === 'prod_berl') {
const res = _parseJourneyLeg(ctx, {
...leg, type: 'WALK'
}, date)
delete res.walking
const mcp = leg.dep.mcp || {}
const mcpData = mcp.mcpData || {}
// todo: mcp.lid
// todo: mcpData.occupancy, mcpData.type
// todo: journey.trfRes.bkgData
res.line = {
type: 'line',
id: null, // todo
// todo: fahrtNr?
name: mcpData.providerName,
public: true,
mode: 'taxi',
product: 'berlkoenig'
// todo: operator
}
return res
}
}
return _parseJourneyLeg(ctx, leg, date)
}

hafas-client/p/bvg/index.js

Lines 160 to 171 in 4189ce4

// use the Berlkönig ride sharing service?
// todo: https://github.com/alexander-albers/tripkit/issues/26#issuecomment-825437320
const requestJourneysWithBerlkoenig = ({opt}, query) => {
if (('numF' in query) && opt.berlkoenig) {
// todo: check if this is still true
throw new Error('The `berlkoenig` and `results` options are mutually exclusive.')
}
query.jnyFltrL.push({type: 'GROUP', mode: 'INC', value: 'OEV'})
if (opt.berlkoenig) query.jnyFltrL.push({type: 'GROUP', mode: 'INC', value: 'BERLKOENIG'})
query.gisFltrL = [{meta: 'foot_speed_normal', type: 'M', mode: 'FB'}]
return query
}

### 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'
}
}
```

@derhuerst
Copy link
Member

derhuerst commented Mar 16, 2024

@olof-nord Do you want to submit a PR?

We could also look into if and how Muva is represented in their HAFAS endpoint. Let's do this in #274.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants