derhuerst / bvg-rest

An HTTP API for Berlin & Brandenburg public transport.
https://v6.bvg.transport.rest/
ISC License
87 stars 4 forks source link

distance in nearby query limited to 500m #1

Closed misteu closed 6 years ago

misteu commented 6 years ago

It seems to work only up to 500m, when I say e.g. distance=1000 it still show only stations up to 500m

derhuerst commented 6 years ago

Can you give me an example to reproduce this?

misteu commented 6 years ago

it seems to be also dependent on the location. E.g. a request with this query (Alexanderplatz): https://1.bvg.transport.rest/stations/nearby?latitude=52.5215595&longitude=13.408969 results in a response with every station within 2km (as expected)

If I change the distance parameter to e.g. 500m -> https://1.bvg.transport.rest/stations/nearby?latitude=52.5215595&longitude=13.408969&distance=500

the last station I get is at 318m. Below 318m I can define the distance, above that it does not have any effect.

For other locations, the "critical value" is different. E.g. this one (Ostbahnhof): https://1.bvg.transport.rest/stations/nearby?latitude=52.5105389&longitude=13.432794 vs. https://1.bvg.transport.rest/stations/nearby?latitude=52.5105389&longitude=13.432794&distance=1500

the last station I see has a distance of 536m.

derhuerst commented 6 years ago

The bvg-rest API is merely a wrapper around their HAFAS endpoint. Apparently, HAFAS only applies the results if you pass a distance limit as well. My guess is that, otherwise, you will reach a different, general limit of 2km.

Unfortunately this is something bvg-rest can't abstract over, without risking slower HAFAS response times. If you still think it's worth changing this, please let me know!

derhuerst commented 6 years ago

Please reopen if you have more questions regarding this.