mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
mark & filter stations that are passed without stopping, as they contain no arrival/departure time information which would violate the fptf spec
This commit is contained in:
parent
54865e67e6
commit
ac56493768
2 changed files with 6 additions and 1 deletions
|
@ -43,7 +43,9 @@ const createParseJourneyLeg = (profile, stations, lines, remarks) => {
|
||||||
|
|
||||||
if (passed && pt.jny.stopL) {
|
if (passed && pt.jny.stopL) {
|
||||||
const parse = profile.parseStopover(profile, stations, lines, remarks, j)
|
const parse = profile.parseStopover(profile, stations, lines, remarks, j)
|
||||||
res.passed = pt.jny.stopL.map(parse)
|
const passedStations = pt.jny.stopL.map(parse)
|
||||||
|
// filter stations the train passes without stopping, as this doesn't comply with fptf (yet)
|
||||||
|
res.passed = passedStations.filter((x) => !x.passBy)
|
||||||
}
|
}
|
||||||
if (Array.isArray(pt.jny.remL)) {
|
if (Array.isArray(pt.jny.remL)) {
|
||||||
for (let remark of pt.jny.remL) applyRemark(j, remark)
|
for (let remark of pt.jny.remL) applyRemark(j, remark)
|
||||||
|
|
|
@ -16,6 +16,9 @@ const createParseStopover = (profile, stations, lines, remarks, connection) => {
|
||||||
res.departure = dep.toISO()
|
res.departure = dep.toISO()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mark stations the train passes without stopping
|
||||||
|
if(st.dInS === false && st.aOutS === false) res.passBy = true
|
||||||
|
|
||||||
// todo: follow public-transport/friendly-public-transport-format#27 here
|
// todo: follow public-transport/friendly-public-transport-format#27 here
|
||||||
// see also derhuerst/vbb-rest#19
|
// see also derhuerst/vbb-rest#19
|
||||||
if (st.aCncl) {
|
if (st.aCncl) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue