OpendataCH / Transport

Swiss public transport API
http://transport.opendata.ch/
MIT License
241 stars 50 forks source link

Feature request #117

Closed awahed closed 8 years ago

awahed commented 8 years ago

in /locations api, is it possibile to have type=train_stations ? where it shows only train stations near a certain lat & lng such as:

http://transport.opendata.ch/v1/locations?x=46.0051960&y=8.94716308&type=train_stations

thank you very much.

hannesgassert commented 8 years ago

@chregu do you have some resources to perhaps look into this?

awahed commented 8 years ago

Any update regarding this issue/request ? Thank you in advance.

fabian commented 8 years ago

I had a quick look and it seems possible with the look_stopclass parameter. However the binary seems to be different than what we use in our Transportations class.

I will look into implementing this next week.

awahed commented 8 years ago

Thank you Fabian.

in /locations api, it would be great if there will be type=train_stations, that can be used both when passed query or (x and y) like in examples below.

Thank you again.

fabian commented 8 years ago

I've implemented the transportations filter now the same way as we already have it for the /connections resource. Train stations can now be filtered like this: http://transport.opendata.ch/v1/locations?x=46.0051960&y=8.94716308&transportations[]=ice_tgv_rj&transportations[]=ec_ic&transportations[]=ir&transportations[]=re_d

Unfortunately SBB doesn't provide a similar filtering option for requests with the query parameter.