diff --git a/features/bicycle/ref.feature b/features/bicycle/ref.feature new file mode 100644 index 000000000..da1585902 --- /dev/null +++ b/features/bicycle/ref.feature @@ -0,0 +1,41 @@ +@routing @bicycle @ref @name +Feature: Bike - Way ref + + Background: + Given the profile "bicycle" + + Scenario: Bike - Way with both name and ref + Given the node map + | a | b | + + And the ways + | nodes | name | ref | + | ab | Utopia Drive | E7 | + + When I route I should get + | from | to | route | + | a | b | Utopia Drive / E7 | + + Scenario: Bike - Way with only ref + Given the node map + | a | b | + + And the ways + | nodes | name | ref | + | ab | | E7 | + + When I route I should get + | from | to | route | + | a | b | E7 | + + Scenario: Bike - Way with only name + Given the node map + | a | b | + + And the ways + | nodes | name | + | ab | Utopia Drive | + + When I route I should get + | from | to | route | + | a | b | Utopia Drive | diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index 12c4a9484..98d03c83d 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -179,8 +179,10 @@ function way_function (way) local surface = way.tags:Find("surface") -- name - if "" ~= ref then - way.name = ref + if "" ~= ref and "" ~= name then + way.name = name .. ' / ' .. ref + elseif "" ~= ref then + way.name = ref elseif "" ~= name then way.name = name else