Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile/car combined name ref #1506

Merged
merged 4 commits into from
Jun 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions features/bicycle/access_node.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ Feature: Bike - Access tags on nodes

Scenario: Bike - Access tag hierachy on nodes
Then routability should be
| node/access | node/vehicle | node/bicycle | bothw |
| | | | x |
| yes | | | x |
| no | | | |
| | yes | | x |
| | no | | |
| no | yes | | x |
| yes | no | | |
| | | yes | x |
| | | no | |
| no | | yes | x |
| yes | | no | |
| | no | yes | x |
| | yes | no | |
| node/access | node/vehicle | node/bicycle | node/highway | bothw |
| | | | | x |
| yes | | | | x |
| no | | | | |
| | yes | | | x |
| | no | | | |
| no | yes | | | x |
| yes | no | | | |
| | | yes | | x |
| | | no | | |
| | | no | crossing | x |
| no | | yes | | x |
| yes | | no | | |
| | no | yes | | x |
| | yes | no | | |

Scenario: Bike - Overwriting implied acccess on nodes doesn't overwrite way
Then routability should be
Expand Down
10 changes: 5 additions & 5 deletions features/car/names.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Feature: Car - Street names in instructions
| | c |

And the ways
| nodes | name |
| ab | My Way |
| bc | Your Way |
| nodes | name | ref |
| ab | My Way | |
| bc | Your Way | A1 |

When I route I should get
| from | to | route |
| a | c | My Way,Your Way |
| from | to | route |
| a | c | My Way,Your Way (A1) |

@todo
Scenario: Car - Use way type to describe unnamed ways
Expand Down
7 changes: 6 additions & 1 deletion profiles/bicycle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,14 @@ end

function node_function (node, result)
-- parse access and barrier tags
local highway = node:get_value_by_key("highway")
local is_crossing = highway and highway == "crossing"

local access = find_access_tag(node, access_tags_hierachy)
if access and access ~= "" then
if access_tag_blacklist[access] then
-- access restrictions on crossing nodes are not relevant for
-- the traffic on the road
if access_tag_blacklist[access] and not is_crossing then
result.barrier = true
end
else
Expand Down
9 changes: 7 additions & 2 deletions profiles/car.lua
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,14 @@ function way_function (way, result)
local service = way:get_value_by_key("service")

-- Set the name that will be used for instructions
if ref and "" ~= ref then
local has_ref = ref and "" ~= ref
local has_name = name and "" ~= name

if has_name and has_ref then
result.name = name .. " (" .. ref .. ")"
elseif has_ref then
result.name = ref
elseif name and "" ~= name then
elseif has_name then
result.name = name
-- else
-- result.name = highway -- if no name exists, use way type
Expand Down