r5py / r5py

Rapid Realistic Routing with R5 in Python
https://r5py.readthedocs.io
Other
119 stars 18 forks source link

Modifying Routes #363

Open RicoFio opened 1 year ago

RicoFio commented 1 year ago

Background R5 supports changing the underlying GTFS data, i.e., removing or adding new routes. I implemented this in a custom wrapper before R5PY but discontinued working on it ~2 years ago. Is this a feature currently in the pipeline for R5PY or R5R (sorry for cross-referencing)?

It's a feature that could add a lot of value to this R5 wrapper, allowing people not to have to deal with low-level GTFS modifications to assess the impact of route modifications on travel times.

Alternative As suggested above, one could take the original GTFS, use a different tool to modify the routes to remove links between stations or alter the shapes of the routes, write the GTFS again to disk, and load it into R5 to run a network analysis. However, manually changing the GTFS and the reading and writing to disk (with un- and re-zipping of the GTFS data) brings a considerable overhead, which could be prohibitive for automated network alteration approaches.

Additional context I'm working on the Equitable Public Transit Network Reduction (EPTNR) problem. To evaluate the impact of network reductions, I need to assess multiple thousands of interventions and their effects on travel times. Thus, doing so directly on the GTFS is infeasible. Given that R5 supports this functionality, I think it should be integrated into this wrapper.

christophfink commented 12 months ago

Hi, thanks for the ideas. In a pythonic/unix-y tradition we don’t want to add too complex extra functionality to this package.

That said, the functionality you describe is contained in the Python package https://gtfs-lite.readthedocs.io , you’re of course still left with reloading the transport network