conveyal / r5

Developed to power Conveyal's web-based interface for scenario planning and land-use/transport accessibility analysis, R5 is our routing engine for multimodal (transit/bike/walk/car) networks with a particular focus on public transit
https://conveyal.com/learn
MIT License
289 stars 74 forks source link

Saving shape information in network.dat (r5r) #751

Open mvpsaraiva opened 3 years ago

mvpsaraiva commented 3 years ago

R5 currently doesn’t save shape information into the network.dat, which is useful for PointToPointQuery used by r5r’s detailed_itineraries()function. This could be easily changed in this line, by making SAVE_SHAPES not final so we could change it at runtime from r5r.

Perhaps if you prefer a more robust implementation, like passing a parameter via TNBuilderConfig (#644), I'm happy to help.

ansoncfit commented 3 years ago

Thanks, @mvpsaraiva.

Including saveShapes as an option in a new networkBuildConfig would be interesting. Beyond PointToPoint mode, this could also allow for more precise path display in Conveyal's publishable stakeholder engagement sites. Without saving shapes, these sites fall back to stop-to-stop lines:

https://github.com/conveyal/r5/blob/3c63f05d72fc2e0fa4f59e4e3498366e5d5e129e/src/main/java/com/conveyal/r5/transit/TripPattern.java#L193-L205

abyrd commented 3 years ago

I think this constant SAVE_SHAPES exists because we had the functionality to save shapes and didn't need it for any current use case, but we didn't want to remove the code, expecting we would have use cases in the future. It is just a hardcoded placeholder parameter. It makes sense to me to promote this to a TNBuilderConfig field.