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

Check if input date is covered in the GTFS feed #326

Open
rafapereirabr opened this issue Mar 14, 2023 · 2 comments
Open

Check if input date is covered in the GTFS feed #326

rafapereirabr opened this issue Mar 14, 2023 · 2 comments

Comments

@rafapereirabr
Copy link
Member

1) Briefly describe your problem and what output you expect

Problem

Every now and then, a user opens a new issue saying that r5r doest not output results accounting for the transit network. Fast forward, we help the user realize they were using a departure date that is outside the GTFS calendar. This has been a common issue in r5py, so they are implementing a simple input check.

Output expected

If user routes with a transit mode, we could test whether the date falls inside the calendar of the GTFS feeds used to build the network. If the input date falls outside the calendar, the function should throw and error with an informative message.

To make this work, it would be ideal if we could extract the start and end dates information of the service calendar cooked into the network built with setup_r5(). Something like this:

start <- r5r_core$service.calendar.start_date

end <- r5r_core$service.calendar.end_date

And then we can use this info to check against the departure_datetime input. @mvpsaraiva , is it possible to expose the r5r_core$service.calendar to R ?

@rafapereirabr
Copy link
Member Author

@mvpsaraiva , is it simple to expose r5r_core$service.calendar.start_date from the Java side ?

@rafapereirabr
Copy link
Member Author

If there are any potential contributors who know Java and who might want to have a look at this, we would appreciate PR from collaborators

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

No branches or pull requests

1 participant