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

where to put transfer information? #30

Open
derhuerst opened this issue Jan 27, 2018 · 1 comment
Open

where to put transfer information? #30

derhuerst opened this issue Jan 27, 2018 · 1 comment

Comments

@derhuerst
Copy link
Member

derhuerst commented Jan 27, 2018

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:

  • fromPosition: where to exit the train, relative to the track/platform
  • toPosition: where to enter the (next) train, relative to the track/platform
  • samePlatform: are the two tracks part of the same platform? (indicating a very short and barrier-free path)

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

  • duplicate it as arrivalSamePlatform & departureSamePlatform? seems inelegant.
  • put a transfer object into the "from" leg? what about the "to" leg?
  • add a new transfers array to the journey? note that not every transfer will have data available, so it will be a sparse array.
  • add transfer legs with the info? (this would be a breaking change)
@derhuerst
Copy link
Member Author

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

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

No branches or pull requests

1 participant