public-transport / friendly-public-transport-format

A format for APIs, libraries and datasets containing and working with public transport data.
Creative Commons Attribution Share Alike 4.0 International
125 stars 1 forks source link

where to put transfer information? #30

Open derhuerst opened 6 years ago

derhuerst commented 6 years ago

context

For Berlin, @juliuste and others have started to specify transfer information. We agreed to use the previous station (before changing lines) and the next station (after changing lines) in order to convey the direction.

an illustration on how our format works

Currently, for a tuple (previousStation, fromStation, fromLines, toLines, toStation, nextStation), we collect the following information:

I'm about to integrate this into the VBB profile or hafas-client. **For the fromPosition and toPosition, it seemed reasonable to put this into the individual journey legs:

[ {
    legs: [ {
        id: '1|31041|35|86|17122017',
        origin: {
            type: 'station',
            id: '900000003201',
            name: 'S+U Berlin Hauptbahnhof',
            // …
        },
        departure: '2017-12-17T19:07:00.000+01:00',
        departurePlatform: '16',
        destination: {
            type: 'station',
            id: '900000024101',
            name: 'S Charlottenburg',
            // …
        },
        arrival: '2017-12-17T19:47:00.000+01:00',
        arrivalPlatform: '8',
        arrivalPosition: 0.3, // <-----------------------here
        arrivalDelay: 30,
        line: {
            type: 'line',
            id: '16845',
            name: 'S7',
            // …
        },
        direction: 'S Potsdam Hauptbahnhof',
        // …
    }, // more lines…
    ]
    // …
} ]

problem

There is a lot more info we might want to cover in the future though. How do we want to store info that doesn't directly belong to the arrival/departure, such as samePlatform or the walking distance?

possible solutions

derhuerst commented 6 years ago

I've just made a first stab by exposing departurePlatform and arrivalPlatform in vbb-hafas.