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
122 stars 1 forks source link

stopover type #35

Closed juliuste closed 6 years ago

juliuste commented 6 years ago

Probably the most important feature FPTF is missing at the moment (IMHO) is the possibility to express departures and arrivals at a specific station (almost every public transport API has an interface for this).

I therefore propose a new type that could look like this (using fptf@1 keywords, disregarding the discussions in #27, #33 or #34 about possible changes in fptf@2 for now).

{
    type: 'stopover', // alternative proposals: 'arrival', 'departure', but this could be misleading since the accurate term in english would be "arrival or departure"
    station: '12345678', // station/stop object, required, name could be misleading since stops should also be valid. maybe 'halt' would be a better name - or two different keys "station" and "stop", but that's also probably not the best solution
    platform: '4-1', // string, optional
    arrival: '2017-03-17T15:00:00+02:00', // ISO 8601 string (with destination timezone), required if `departure` is null
    arrivalDelay: -45, // seconds relative to scheduled arrival, optional
    departure: '2017-03-16T20:00:00+01:00', // ISO 8601 string (with station/stop timezone), required if `arrival` is null
    departureDelay: 120, // seconds relative to scheduled departure, optional
    schedule: '1234', // schedule id or object
    mode: 'train', // see section on modes, overrides `schedule` mode
    subMode: …, // reserved for future use, overrrides `schedule` subMode
    public: true, // publicly accessible?, overrides `schedule` public
    operator: 'sncf' // operator id or operator object, overrides `schedule` operator
}

Any opinions / further proposals?

derhuerst commented 6 years ago

station: '12345678',

I'm in favour of stop, as it would be consistent with route.

`platform: '4-1',

Some means of transport, including some ferries and trains, have different platforms on arrival and on departure. Although I'm usually in favour of keeping things simple, in this case platform would convey something wrong essentially.

Therefore I'd propose departurePlatform and arrivalPlatform, which would be consistent with journey.

mode: 'train',

This should be required, right?

juliuste commented 6 years ago

I'm in favour of stop, as it would be consistent with route.

Agreed.

Some means of transport, including some ferries and trains, have different platforms on arrival and on departure. Although I'm usually in favour of keeping things simple, in this case platform would convey something wrong essentially.

Therefore I'd propose departurePlatform and arrivalPlatform, which would be consistent with journey.

Agreed.

mode: 'train',

This should be required, right?

Agreed.

😄