schildbach / public-transport-enabler

Unleash public transport data in your Java project.
https://groups.google.com/forum/#!forum/public-transport-enabler-discuss
GNU General Public License v3.0
390 stars 133 forks source link

ParisProvider: queryTrips returns only 1 trip #18

Closed grote closed 9 years ago

grote commented 9 years ago

I queried a couple of trips and there's usually only one trip returned while all the other providers return at least 3 trips.

Also, querying for earlier or later trips does not work for me, at least not the same way it does for other providers.

This is probably for @aelkhour.

aelkhour commented 9 years ago

I'll provide for the first point a fix early January, thanks.

What is the expected behavior for earlier and later trips?

schildbach commented 9 years ago

It's basically paging. If you request 4 trips and then request a later 4 trips you should get the same 8 trips you would have gotten if you requested 8 trips to begin with. (Of course if you operate on dynamic data, it can happen that the query for next yields more recent data than you would have gotten at the time of the first call.)

One difference between the various implementations is that some return really only the next trips, and some will repeat everything that was queried already and add the next trips. Öffi tries to accomodate for that, but I suspect there's still bugs lurking. As a rule of thumb, return whatever you get from the server.

aelkhour commented 9 years ago

@schildbach I had set the requested trip count to 1 for testing purposes, but I realised that now navitia returns only one trip unless specified otherwise. Should I take the default trip count for the navitia provider, or hardcode some value?

schildbach commented 9 years ago

AbstractNetworkProvider has the "numTripsRequested" property. That's the value you should use. Currently the default is set to 6. If Navitia for some reason should have a lower default, it might make sense to refactor the code to allow the service provider pick a default.

aelkhour commented 9 years ago

@grote Could you retest please?

grote commented 9 years ago

I'm getting 6 trips now like expected. Thanks for the fix!