OpendataCH / Transport

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

"type" ignored in locations query #187

Open robachmann opened 6 years ago

robachmann commented 6 years ago

I'm trying to get a list of stations but it seems that all location types are returned instead:

doc: http://transport.opendata.ch/docs.html#locations request: http://transport.opendata.ch/v1/locations?query=Z%C3%BCrich-Bahnhofstrasse&type=station response:

...
{"id":null,"name":"UBS Switzerland AG Bahnhofstrasse, Z\u00fcrich, Bahnhofstr. 72","score":null,"coordinate":{"type":"WGS84","x":null,"y":null},"distance":null}
...

I would expect to receive a list with only stations in it, no pois or addresses.

fabian commented 6 years ago

Correct, the type parameter is currently not supported, there's no matching parameter on https://timetable.search.ch/api/help#stationboard.

helbling commented 6 years ago

Use the official list if you're not interested in autocompletion: https://opentransportdata.swiss/de/dataset/didok

robachmann commented 6 years ago

Thanks, Christian. That list helped a lot and I'm able to query the connections endpoint successfully. @fabian, if you don't plan to support the type query, you're free to close this issue.

Thank you both very much.

jonaswirth commented 4 years ago

Is it planned to support this parameter anytime in the near future? If not maybe you could remove it from the documentation as it currently implies the parameter is working as expected.