Remove {highway: type} fallback from bike / walk profile, fixes #3231

References:
- https://github.com/Project-OSRM/osrm-text-instructions/issues/62#issuecomment-257889721
- https://github.com/Project-OSRM/osrm-text-instructions/pull/63
This commit is contained in:
Daniel J. Hofmann 2016-11-08 12:55:32 +01:00
parent 9c11f4231c
commit ef2261661c
7 changed files with 16 additions and 27 deletions

View File

@ -21,7 +21,7 @@ Feature: Bike - Street names in instructions
| a | c | My Way,Your Way,Your Way | A6,A7,A7 | | a | c | My Way,Your Way,Your Way | A6,A7,A7 |
@unnamed @unnamed
Scenario: Bike - Use way type to describe unnamed ways Scenario: Bike - No longer use way type to describe unnamed ways, see #3231
Given the node map Given the node map
""" """
a b c d a b c d
@ -34,4 +34,4 @@ Feature: Bike - Street names in instructions
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | d | {highway:cycleway},{highway:track},{highway:track} | | a | d | , |

View File

@ -30,7 +30,7 @@ Feature: Bike - Way ref
When I route I should get When I route I should get
| from | to | route | ref | | from | to | route | ref |
| a | b | {highway:primary},{highway:primary} | E7,E7 | | a | b | , | E7,E7 |
Scenario: Bike - Way with only name Scenario: Bike - Way with only name
Given the node map Given the node map

View File

@ -21,7 +21,7 @@ Feature: Foot - Street names in instructions
| a | c | My Way,Your Way,Your Way | | a | c | My Way,Your Way,Your Way |
@unnamed @unnamed
Scenario: Foot - Use way type to describe unnamed ways Scenario: Foot - No longer use way type to describe unnamed ways, see #3231
Given the node map Given the node map
""" """
a b c d a b c d
@ -34,4 +34,4 @@ Feature: Foot - Street names in instructions
When I route I should get When I route I should get
| from | to | route | | from | to | route |
| a | d | {highway:footway},{highway:track},{highway:track} | | a | d | , |

View File

@ -15,8 +15,8 @@ Feature: Foot - Way ref
| ab | Utopia Drive | E7 | | ab | Utopia Drive | E7 |
When I route I should get When I route I should get
| from | to | route | | from | to | route | ref |
| a | b | Utopia Drive,Utopia Drive | | a | b | Utopia Drive,Utopia Drive | E7,E7 |
Scenario: Foot - Way with only ref Scenario: Foot - Way with only ref
Given the node map Given the node map
@ -29,8 +29,8 @@ Feature: Foot - Way ref
| ab | | E7 | | ab | | E7 |
When I route I should get When I route I should get
| from | to | route | | from | to | route | ref |
| a | b | {highway:primary},{highway:primary} | | a | b | , | E7,E7 |
Scenario: Foot - Way with only name Scenario: Foot - Way with only name
Given the node map Given the node map

View File

@ -30,4 +30,4 @@ Feature: Bike - Mode flag
When I route I should get When I route I should get
| waypoints | route | turns | | waypoints | route | turns |
| a,f | street,{highway:path},road,road | depart,turn right,turn right,arrive | | a,f | street,,road,road | depart,turn right,turn right,arrive |

View File

@ -106,7 +106,6 @@ local turn_bias = 1.4
-- local safety_penalty = 0.7 -- local safety_penalty = 0.7
local safety_penalty = 1.0 local safety_penalty = 1.0
local use_public_transport = true local use_public_transport = true
local fallback_names = true
local function parse_maxspeed(source) local function parse_maxspeed(source)
if not source then if not source then
@ -214,11 +213,6 @@ function way_function (way, result)
-- name -- name
if name and "" ~= name then if name and "" ~= name then
result.name = name result.name = name
-- TODO find a better solution for encoding way type
elseif fallback_names and highway then
-- if no name exists, use way type
-- this encoding scheme is expected to be a temporary solution
result.name = "{highway:"..highway.."}"
end end
-- ref -- ref

View File

@ -70,8 +70,6 @@ properties.max_speed_for_map_matching = 40/3.6 -- kmph -> m/s
properties.use_turn_restrictions = false properties.use_turn_restrictions = false
properties.continue_straight_at_waypoint = false properties.continue_straight_at_waypoint = false
local fallback_names = true
function get_restrictions(vector) function get_restrictions(vector)
for i,v in ipairs(restrictions) do for i,v in ipairs(restrictions) do
vector:Add(v) vector:Add(v)
@ -153,9 +151,6 @@ function way_function (way, result)
-- name -- name
if name and "" ~= name then if name and "" ~= name then
result.name = name result.name = name
elseif highway and fallback_names then
result.name = "{highway:"..highway.."}" -- if no name exists, use way type
-- this encoding scheme is excepted to be a temporary solution
end end
if ref and "" ~= ref then if ref and "" ~= ref then
result.ref = ref result.ref = ref