Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trips-for-route should return the next active trips if called while a route is inactive #232

Open
nakkore opened this issue Nov 13, 2019 · 6 comments

Comments

@nakkore
Copy link

nakkore commented Nov 13, 2019

If I call trips-for-route for a route which I know is active on certain day the api returns the trips correctly. Conversely if the api is called when the route is not active it would be useful to return trips belonging to the next active day by which the route is in service.

Example:
route 16F is in service just on Sundays.
trips-for-route should return trips for 16F even if I call the api from Monday to Saturday.

Thank you

@nakkore nakkore changed the title trips-for-route should return inactive trips as well trips-for-route should return the next active trips if called while a route is inactive Nov 13, 2019
@barbeau
Copy link
Member

barbeau commented Nov 14, 2019

Have you tried adding includeSchedule=true to the request? I don't recall the exact behavior of the API off the top of my head but this might give you what you want.

http://developer.onebusaway.org/modules/onebusaway-application-modules/current/api/where/methods/trips-for-route.html

@nakkore
Copy link
Author

nakkore commented Nov 14, 2019

Yes, I've just tried. The response returns something like
{"code":200,"currentTime":1573767212421,"data":{"limitExceeded":false,"list":[],"outOfRange":false,"references":{"agencies":[],"routes":[],"situations":[],"stops":[],"trips":[]}},"text":"OK","version":2}

@barbeau
Copy link
Member

barbeau commented Nov 14, 2019

@nakkore I seem to recall seeing that myself. So yes, I think this is a valid feature request, as IIRC I've looked for the same thing in the past. PR are welcome! :)

@nakkore
Copy link
Author

nakkore commented Nov 14, 2019

well to be fair I've tried to understand the code with the help of a debugger to find out how the trip for route behaves when it returns active trips. I must say that lack of comments in the code and my limited knowledge in the gtfs format don't help. I've got not prob submitting a PR but I'd need a bit of guidance or at least someone that tell me why a certain method behaves in a certain way.

@barbeau
Copy link
Member

barbeau commented Nov 14, 2019

@nakkore Feel free to ask questions, although right now reviews of features that aren't directly supported by funded projects at agencies have a best-effort level of support. So don't be offended if it takes someone a while to review and reply, as most are doing it in their free time.

@nakkore
Copy link
Author

nakkore commented Nov 15, 2019

thanks I'm working on this thing in my free time as well and I do understand your point. Hope to get to the bottom of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants