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

Internal workings of the API #327

Open
Mark531 opened this issue Oct 14, 2024 · 3 comments
Open

Internal workings of the API #327

Mark531 opened this issue Oct 14, 2024 · 3 comments

Comments

@Mark531
Copy link

Mark531 commented Oct 14, 2024

Hello,

I'm using your API through https://v5.db.transport.rest and I have some questions about its internal workings if you don't mind.

I'm looking for all reachable destinations from Paris Gare du Nord:
https://v5.db.transport.rest/stops/reachable-from?latitude=48.880697&longitude=2.354598&address=%27%27&maxDuration=300
I get London St Pancras associated with a duration of 79 min.

Now, if looking for all reachable destinations from London St Pancras:
https://v5.db.transport.rest/stops/reachable-from?latitude=51.531922&longitude=-0.126361&address=%27%27&maxDuration=300
I get Paris Nord Eurostar associated with a duration of... 199 min!

Why is that? The 1 hour time difference between Paris and London doesn't explain the 2 hour difference. My questions are the following: when computing the trip durations, are time differences taken into account? Moreover, does the API take into account the difference between the current time and the time departure of the train (so if the train will leave in 4 hours, will these 4 hours be added to the total duration)? And is the current search based on the current time (in other words if I run a search at 3:00 am for instance, won't the API return anything)?

Thanks in advance,
Mark

@derhuerst
Copy link
Member

derhuerst commented Jan 9, 2025

Note that reachableFrom()/stops/reachable-from is time-dependent, so it is affected by the trains available at that particular date+time.

This (weird durations with travels across time zone borders) might be a bug in HAFAS (or in hafas-client!), please try to investigate further. Could it be that it found a 79+60 min connection from Paris to London, and a 199-60 connection back? Please tripe-check this assumption by a) querying journeys (using journeys()//journeys) that use such a connection, and b) by checking actual PDF/website timetables.

@Mark531
Copy link
Author

Mark531 commented Jan 10, 2025

Sure, I can investigate by running the query with different times. But today, I'm unable to make any run. All queries trigger a 503 error without any message. Are you currently working on the API?

@traines-source
Copy link
Member

See #331, I think there exist no bugs in the DB HAFAS API anymore, since it has probably been discontinued.

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

No branches or pull requests

3 participants