public-transport / db-hafas

JavaScript client for the Deutsche Bahn HAFAS API.
https://github.com/public-transport/db-hafas
ISC License
75 stars 5 forks source link

results option has no effect #9

Closed kontextbewusst closed 6 years ago

kontextbewusst commented 7 years ago

First of all, thank you for this nice API!

I discovered that the results option parameter for the stationsNearby search has no effect (at least for the cases that I tested). It does not matter if I pass in 1, 5, or 10 -- the API always delivers more stations.

For example, hafas.nearby( 50.967417, 11.031457 ) gives me 33 results, where as the documentation states that 8 should be the default value for the results parameter. hafas.nearby( 50.967417, 11.031457, { results: 5 } ) yields the same amount of stations.

derhuerst commented 7 years ago

see also derhuerst/vbb-hafas#18, it is the same issue with Berlin & Brandenburg public transport.

kontextbewusst commented 7 years ago

I see... so this is a Hafas issue?

derhuerst commented 7 years ago

Not sure if they stopped recognising the field or if I introduced a bug. I'm not too familiar with all the special names and abbreviations. Will look into it soon.

derhuerst commented 6 years ago

It looks like the results option only works if the distance option is also being used. AFAIK this is given by the server, so I can't change it.