bike: use both ref&name when available

This commit is contained in:
Emil Tin 2013-04-28 11:42:21 +02:00
parent 7ac901cb08
commit 3afcd31f61
2 changed files with 45 additions and 2 deletions

View File

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

View File

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