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
280 stars 73 forks source link

Adjusting cycling defaults / Cycling disallowed on one-way street #836

Open Robinlovelace opened 1 year ago

Robinlovelace commented 1 year ago

In some cases, e.g. when researching safe routes to school, it is useful to allow cycling on footways. This is especially the case in places where tagging is not complete. For example, this footpath in Leeds is definitely cyclable and a nice place to go by bike, with good surface quality and plenty of width for walking and cycling and more, in fact it's a place where many people first learn to ride a bike: https://www.openstreetmap.org/way/306849934#map=17/53.81989/-1.52460

I've updated the OSM data so that bicycle=yes. Before that change it seemed to be impossible to get R5 to allow cycling there. Is there any way to enable cycling on ways like that?

Even less realistic, I notice that this way is a no go for cycling according to R5. It seems to happen where the road becomes one way for driving, it splits in 2 but is the same road and just as cyclable. This does not make sense: https://www.openstreetmap.org/way/615612433

See below for a visualisation of the R5 outputs including these ways:

First reported here: https://github.com/ipeaGIT/r5r/issues/302

abyrd commented 1 year ago

Hi @Robinlovelace, thanks for the report and sorry for the delay. In R5, for the most part we want to avoid heuristics or guesswork in interpreting OSM data - we'd usually view this as an input data problem and adjust the OSM data. We probably wouldn't want to change this behavior because https://wiki.openstreetmap.org/wiki/Tag:highway%3Dfootway says "Where a pathway is designated for pedestrians but is also allowed for bicycles you can use highway=footway and bicycle=yes"

I understand it may be difficult to make such edits in a large number of locations, and you would like to apply a blanket change, but R5 does not have a domain-specific configuration language for overriding the interpretation of OSM tags (e.g. saying that highway=footway always implies bicycle=yes). At present this would have to be done by changing the source code of R5, or by applying a batch transformation on the input OSM data.

As for the one-way road being forbidden to bicycles, this does seem like a bug. There doesn't seem to be much of anything in the tagging other than the oneway status that differentiates between the portions of the road where bicycle is true or false.

There are some fairly complicated rules for handling one-way street tags so we may want to trace execution when loading a tiny OSM extract around here: https://github.com/conveyal/r5/blob/dev/src/main/java/com/conveyal/r5/labeling/TraversalPermissionLabeler.java#L110

abyrd commented 1 year ago

We may want to work on this together with #849 if they involve related logic and testing procedures.

ansoncfit commented 1 year ago

The example above shows where traversal is unexpectedly restricted for bikes. We are also discussing how to re-enable one-way roads for linking from search origins (at https://github.com/conveyal/r5/issues/515)