Skip to content

Destinations ignored on two-way roads #4729

@1ec5

Description

@1ec5

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.

richards

The cause is that the following code calls get_destination() only if the road is a one-way road:

-- 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:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions