Transport icon indicating copy to clipboard operation
Transport copied to clipboard

Limit is buggy

Open dbrgn opened this issue 12 years ago • 3 comments

http://localhost/transport/web/api.php/v1/connections?from=bern&to=z%C3%BCrich&date=2012-04-08&time=18:40&limit=4

This returns 5 connections instead of 4.

dbrgn avatar Apr 08 '12 16:04 dbrgn

This happens if two and more trains departure at the same time. Debugged this with @gwrtheyrn. The limit only specifies departure times not connections. Feature or bug? The same issue is visible on sbb.ch for the given connection.

If this is a feature of the Hafas api, nothing has to be changed. If this is a bug, an array_splice should do the trick.

dol avatar Apr 08 '12 19:04 dol

We documented this behavior for the /stationboard call already: http://transport.opendata.ch/#stationboard

I'm pretty sure this is a hafas feature, and I'd leave it as is, since otherwise we'd have to make a decision on which connection is less important and can be cut off.

colinfrei avatar Apr 09 '12 12:04 colinfrei

I think this would be pretty easy, the one that arrives at the destination earlier is more important than the one that takes longer.

I find the current behavior a little strange and think the API should fix that :)

dbrgn avatar Apr 09 '12 12:04 dbrgn