BVG: parse high occupancies

This commit is contained in:
Jannis R 2021-10-29 13:03:58 +02:00
parent 69ddf5fb8d
commit 6941e7a4ad
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -19,6 +19,7 @@ const {
const baseProfile = require('./base.json') const baseProfile = require('./base.json')
const products = require('./products') const products = require('./products')
// todo: there's also a referenced icon `{"res":"occup_fig_{low,mid}"}`
const addOccupancy = (item, occupancyCodes) => { const addOccupancy = (item, occupancyCodes) => {
const remIdx = (item.remarks || []) const remIdx = (item.remarks || [])
.findIndex(r => r.code && occupancyCodes.has(r.code)) .findIndex(r => r.code && occupancyCodes.has(r.code))
@ -34,12 +35,12 @@ const addOccupancy = (item, occupancyCodes) => {
const stopoverOccupancyCodes = new Map([ const stopoverOccupancyCodes = new Map([
['text.occup.loc.max.11', 'low'], ['text.occup.loc.max.11', 'low'],
['text.occup.loc.max.12', 'medium'], ['text.occup.loc.max.12', 'medium'],
// todo: high ['text.occup.loc.max.13', 'high'],
]) ])
const journeyLegOccupancyCodes = new Map([ const journeyLegOccupancyCodes = new Map([
['text.occup.jny.max.11', 'low'], ['text.occup.jny.max.11', 'low'],
['text.occup.jny.max.12', 'medium'], ['text.occup.jny.max.12', 'medium'],
// todo: high ['text.occup.jny.max.13', 'high'],
]) ])
// todo: https://m.tagesspiegel.de/berlin/fahrerlebnis-wie-im-regionalexpress-so-faehrt-es-sich-in-der-neuen-express-s-bahn/25338674.html // todo: https://m.tagesspiegel.de/berlin/fahrerlebnis-wie-im-regionalexpress-so-faehrt-es-sich-in-der-neuen-express-s-bahn/25338674.html