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

[Suggestion] add an option to allow 1 connection #14

Open
Andrea-FEVE opened this issue May 9, 2022 · 8 comments
Open

[Suggestion] add an option to allow 1 connection #14

Andrea-FEVE opened this issue May 9, 2022 · 8 comments
Labels
data-source-issue Issue related to the current source of data, which is - for now - either hard or impossible to fix.

Comments

@Andrea-FEVE
Copy link

Only 1 connection offers so many more possibilities for travelling, with little inconvenience. I would love to see where I wan travel with only 1 change.

@juliuste juliuste added the data-source-issue Issue related to the current source of data, which is - for now - either hard or impossible to fix. label May 20, 2022
@juliuste
Copy link
Owner

Thanks for the suggestion, I would really like this as well! Unfortunately, it seems borderline impossible to implement such a feature with the current data source the app is using, see also this gist.

I will however keep this in mind for the future, and if anyone else has an idea how to implement this with the current API, please let me know 🙂

@pitrade
Copy link

pitrade commented May 25, 2022

This Feature would be very interesting because of the upcoming 9€-Ticket. Long travel durations are outweighed by higher price differences between local and long distance trains. An heuristic to implement this could be to run the api call again for each station in the result of the origin. Then delete every station in the secondary results which occurs in first one. Add up both durations plus an estimation of 30 Minutes for the change. Combine the results but only the lowest duration for each station.
To improve the performance you could extend the current api by the number of adjacent stations. There is no need to call the api again for a station in the result if this value is 2 or lower.

@astroleo
Copy link

How difficult would it be to store the entire connection list in a local database (to be updated every once in a while of course)? There are 5700 stations in Germany, perhaps 50,000 in Europe? Each of them has direct connections to perhaps 100 places on average? If you stored these 5 million possible direct journeys, you could easily answer the question how many places are reachable within 1 (or any number of) changes, too. The total travel time wouldn't be accurately known, however, because the connection information is lost this way, but perhaps, for long-distance journeys, that isn't that relevant?

@juliuste
Copy link
Owner

This doesn't work with the current data source, unfortunately, because it would require too many requests (as far as I can tell). One would need a static dataset/dump for that, and unfortunately there is no such thing at the moment - at least AFAIK.

@astroleo
Copy link

Thanks. Can you say how many requests are allowed (per time)? Perhaps this information could be crowdsourced by running a script on multiple computers…?

@pitrade
Copy link

pitrade commented May 26, 2022

How about this easier solution: When you click on a directly reachable station, that station becomes the new origin. Only one request per click ist needed but unlimited changes are possible then.

@xeruf
Copy link

xeruf commented Sep 15, 2022

yes, that last suggestion is also what I expected, maybe the extra features can be made available on hover and/or right-click

@tuukka
Copy link

tuukka commented Apr 30, 2023

This would be important also for knowing if a faster trip but with a transfer exists in addition to the direct trip. (As a special case, you'd be able to answer this question for two stations with two queries: try to join all the departing trains of the origin station with all the arriving trains of the destination station.)

Idea: You wouldn't need to fetch the data for all the stations in Europe: you can pick a (hopefully small) set of stations that cover all the trains in Europe. You couldn't fetch these once per user, but maybe once per day? (Do you already store all the results that are fetched?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data-source-issue Issue related to the current source of data, which is - for now - either hard or impossible to fix.
Projects
None yet
Development

No branches or pull requests

6 participants