OpendataCH / Transport

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

Paramater 'transportations' not working in stationboard #182

Closed martinjaehn closed 5 years ago

martinjaehn commented 6 years ago

Hello world

I'm using the following GET request in order to get the departing buses from Lenzburg: http://transport.opendata.ch/v1/stationboard?id=8502119&limit=50&transportations[]=bus

This request is returning everything, instead of only buses. Am I using the 'transportations' parameter the wrong way? It doesn't matter what I type as the value of the parameter, it always returns every possible connection (trains, buses, etc.)

Kind regards Martin

fabian commented 6 years ago

Similiar to #164, currently missing from https://timetable.search.ch/api/help#stationboard

helbling commented 6 years ago

Hi

We have introduced a new parameter transportation_types on the timetable.search.ch API. See documentation here: https://fahrplan.search.ch/api/help#route

Note that not all the filters the transport api supported in the past work, as we don't think the very fine-graned train filters are ever needed.

Example: https://fahrplan.search.ch/api/route.json?from=Z%C3%BCrich+HB&to=Rapperswil+SG&transportation_types=ship,tram

fabian commented 6 years ago

Support for transportations parameter has been added again for connections, still missing for stationboard.

helbling commented 5 years ago

The transportation_types parameter now works in our stationboard api as well: http://fahrplan.search.ch/api/stationboard.json?stop=Z%C3%BCrich,Bellevue&transportation_types=bus

fabian commented 5 years ago

Thanks @helbling!

Filtering the station board by transportations now works again: http://transport.opendata.ch/v1/stationboard?id=8502119&limit=50&transportations%5B%5D=bus

bluecatpixel commented 5 years ago

Hi @fabian I just found that there are some issues regarding the requests with transportations types like trains and trams. I see that you changed the types. Wasn't the version incremented? Does it means that I need to change the types with v1? Thanks

fabian commented 5 years ago

@bluecatpixel Sorry, the change of types was a side effect of the change explained in https://opendata.ch/2017/06/search-ch-rettet-transport-opendata-ch/.

Yes, I would recommend you change the types on your side.

If you think it's worth mapping the old types to the new transportation types please create a pull request.

bluecatpixel commented 5 years ago

@fabian thanks for the answer...I'll discuss with my colleagues but I guess it will faster to change it.

Cheers.

Bcow7 commented 5 years ago

Hi @fabian!

I followed your suggestion to map the old types to the new transportation types because we have a lot of devices that are currently not showing any train informations anymore and the deployment of our update will take some time. If you accept the pull request #193 it will be more backwards compatible.

Cheers! Florent