-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
OSRM ignores destination tags on ways that are tagged oneway=no or that lack a oneway tag. For example, @abhisheksaikia found that this way appears without a destination in this route despite having destination:backward and destination:ref:backward tags.
The cause is that the following code calls get_destination() only if the road is a one-way road:
osrm-backend/profiles/lib/way_handlers.lua
Lines 103 to 109 in 979ec7f
| -- handle destination tags | |
| function WayHandlers.destinations(profile,way,result,data) | |
| if data.is_forward_oneway or data.is_reverse_oneway then | |
| local destination = get_destination(way, data.is_forward_oneway) | |
| result.destinations = canonicalizeStringList(destination, ",") | |
| end | |
| end |
This code originally lived in the one-way handler:
Lines 637 to 645 in 0fbd18b
| function handle_oneway(way,result) | |
| local oneway = way:get_value_by_key("oneway") | |
| if obey_oneway then | |
| if oneway == "-1" then | |
| result.forward_mode = mode.inaccessible | |
| local is_forward = false | |
| local destination = get_destination(way, is_forward) | |
| result.destinations = canonicalizeStringList(destination, ",") |
It looks like this behavior was introduced intentionally in c7e1939 for #2328 to work around tagging mistakes like using destination instead of destination:forward on a two-way road. While mappers can still be prone to that kind of mistake, it’s better to rely on linters to catch these issues. Also, #3061 implemented support for destination:forward and destination:backward in the meantime.
/cc @ghoshkaj @daniel-j-h
