Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.43k stars 3.4k forks source link

`highway=road` should be excluded from all routing profiles #7039

Open cmoffroad opened 1 month ago

cmoffroad commented 1 month ago

Issue

According to the OpenStreetMap highway=road wiki, roads with an unknown classification should be considered errors and shouldn't be routable.

Currently, on the OSM site, the OSRM demo shows that while the car profile correctly excludes such roads, the foot and bicycle profiles still include them.

Steps to Reproduce

  1. Go to: OSM Directions.
  2. Switch between Bicycle (OSRM), Car (OSRM), and Foot (OSRM) profiles.
  3. Notice that the Bicycle and Foot profiles don't exclude the unknown road between the start and end points, whereas the Car profile does.
1ec5 commented 1 month ago

1980 discusses the justification for omitting highway=road from the car profile, with references to the wiki. (However, that discussion happened before the wiki was modified to contain this warning.) I don’t see any discussion here about highway=road in the foot and bicycle profiles, but there are tests ensuring routability by default:

https://github.com/Project-OSRM/osrm-backend/blob/4f1c62a768120140bae0d2856f3ac0db47e07d72/features/foot/way.feature#L24 https://github.com/Project-OSRM/osrm-backend/blob/4f1c62a768120140bae0d2856f3ac0db47e07d72/features/bicycle/way.feature#L28

If I had to guess, the assumption might be the same as for any other roadway without an explicit foot=*, bicycle=*, sidewalk=*, or cycleway=* tag: that the pedestrian can walk along the side of the road, regardless of the state of the road itself. Similarly, a cyclist can dismount and push their bicycle:

https://github.com/Project-OSRM/osrm-backend/blob/4f1c62a768120140bae0d2856f3ac0db47e07d72/features/bicycle/way.feature#L8

In other words, while the wiki says you shouldn’t expect a router to tell someone to walk on this road, it doesn’t say the router shouldn’t tell them to walk beside the road. This isn’t a very good assumption for highway=road in my opinion, but it probably slipped under the radar because highway=road is so rare in the regions that use OSRM the most.

tombay commented 1 month ago

I see that https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions does include highway=road in a number of countries. (Worldwide, Austria...). It should be adjusted also.

cmoffroad commented 1 month ago

I see that https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions does include highway=road in a number of countries. (Worldwide, Austria...). It should be adjusted also.

It should probably not be there. Multiple countries have already explained that:

"Common rule about routing along highway=road can not be determined, because highway=road is a line which can be a road or not, and if it is a road, it is a road with unknown status. The recommendation is to exclude highway=road from routing or to give such lines the lower status in roads' graph."

cmoffroad commented 1 month ago

In other words, while the wiki says you shouldn’t expect a router to tell someone to walk on this road, it doesn’t say the router shouldn’t tell them to walk beside the road.

You’re assuming that highway=road means it’s an actual public road, but it could totally be private, not even exist, or maybe there’s even a wall blocking it off.

1ec5 commented 1 month ago

highway=residential can also totally be private or blocked off by a wall. access=unknown or some other access tag would be required to dissuade the router in that case.

In any event, the reason I disagree with the profile’s assumption is not that the road itself might be inaccessible. Rather, the router shouldn’t assume that an inaccessible road has an accessible sidewalk or verge, even without any tag saying so. That would be especially nonsensical for something as ambiguous as highway=road.

cmoffroad commented 1 month ago

highway=residential can also totally be private or blocked off by a wall. access=unknown or some other access tag would be required to dissuade the router in that case.

However, highway=road and other highway classifications shouldn’t be treated the same way. highway=road can be used for imports or tracing from imagery, leading to segments that may not exist at all. While a highway=residential might not exist too, that would be considered a mapping error. In contrast, with highway=road, it’s not expected to be rendered or routed, so such segments wouldn’t be normally visible or accessible to normal end-users.