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

add connection search from station to station #21

Open
maltegoetz opened this issue May 2, 2016 · 9 comments
Open

add connection search from station to station #21

maltegoetz opened this issue May 2, 2016 · 9 comments

Comments

@maltegoetz
Copy link

For a lot of applications it would be really useful to be able to pull a list of connections between two stations. At the moment a lot of applications just simulate calls from the DB mobile apps which is sophisticated and does not fit to the openData initiative.

@highsource
Copy link
Collaborator

Noted.

At the moment the best choices are Public Transport Enabler or rolling your own with GTFS.

@reghrafa
Copy link

reghrafa commented May 2, 2016

That would be pretty neat!

@J0ANMM
Copy link

J0ANMM commented Jun 26, 2016

This would be definitely a very useful feature!

Until this is available, I've created something in Python that seems to work:
https://github.com/J0ANMM/db-legs

Feel free to contribute in order to improve it and optimize it! :)
Also, as this requires a big amount of requests to the DB API, it would be interesting to have also DB's point of view to make sure it does not overload the servers or something like that.

@highsource
Copy link
Collaborator

@J0ANMM Why don't you just take GTFS? That was already created by @fredlockheed:
https://github.com/fredlockheed/db-fv-gtfs

You won't need to make any API accesses then.

@J0ANMM
Copy link

J0ANMM commented Jun 26, 2016

I had a look at it, but what I understood is that it takes 2 days to get everything and it is somehow fixed data.
I was looking for something more dynamic, that it can be updated as soon as new data is available.
In addition, there could be the case that only some of the stations are of interest. In that case, modifying slightly the code could give a mean to obtain the relevant data in a fastest way.

Did I misunderstand how GTFS works?

@highsource
Copy link
Collaborator

@J0ANMM The data is there: https://github.com/fredlockheed/db-fv-gtfs/files/201511/2016.0.1.zip
Just download.

Next, DB Fahrplan API only offers planned data ("SOLL-Fahrplan"). I don't think there will be "new" data available anyway.

@J0ANMM
Copy link

J0ANMM commented Jun 26, 2016

Very interesting indeed. Then I can adapt it to retrieve the data from there when creating the legs.

Thanks for the feedback!

@J0ANMM
Copy link

J0ANMM commented Jul 8, 2016

Code has been updated to get all the data from GTFS:
https://github.com/J0ANMM/db-legs

Feel free to have a look.

It takes around 10min to create the table with all possible upcoming legs. As of today with the latest release, that is >10,000,000 rows.
Then it takes less than one minute to get all legs between two stations for a specific date in JSON format.

@SimWoh
Copy link

SimWoh commented Apr 5, 2018

Hey guys!
Since there is a new DB-API (http://api.deutschebahn.com/fahrplan-plus/v1) your great solutions to find the connections between cities aren't working for me anymore.
Do you have a quick fix solution to find the connections between stations in a specific time by using this API ?

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

No branches or pull requests

5 participants