Directional Destination Tags (#3061)

* cucumber test scenarios, #3027

* post review comments

* two tests are still failing

* fixed one test

* passing tests

* cleaner code refactor

* possible sceanrios for destination:ref:forward/backward

* added code for direction:ref:forward/backward, tests pass

* changelog

* store direction in variable

* added tags to taginfo

* fixed dumb error

* use boolean flags

* null pointer checks

* hopefully better null pointer checks
This commit is contained in:
Kajari Ghosh
2016-10-18 23:09:19 -04:00
committed by GitHub
parent f77a2474ea
commit 3f0f0e306b
6 changed files with 144 additions and 11 deletions
+5 -6
View File
@@ -498,20 +498,19 @@ function way_function (way, result)
-- Set direction according to tags on way
if obey_oneway then
if oneway == "-1" then
local is_forward = false
result.forward_mode = mode.inaccessible
result.destinations = get_destination(way, is_forward)
elseif oneway == "yes" or
oneway == "1" or
oneway == "true" or
junction == "roundabout" or
(highway == "motorway" and oneway ~= "no") then
local is_forward = true
result.backward_mode = mode.inaccessible
-- If we're on a oneway and there is no ref tag, re-use destination tag as ref.
local destination = get_destination(way)
local has_destination = destination and "" ~= destination
result.destinations = destination
result.destinations = get_destination(way, is_forward)
end
end
-- Override speed settings if explicit forward/backward maxspeeds are given