Skip to content

Commit

Permalink
Handle small roundabouts, fixes #516.
Browse files Browse the repository at this point in the history
This gives us ~51k additional roundabout instructions.
Guidance handes sizes internally.

Note: it is highway=mini_roundabout but junction=roundabout

References:
- http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmini_roundabout
- http://wiki.openstreetmap.org/wiki/Tag:junction=roundabout
- http://taginfo.openstreetmap.org/tags/highway=mini_roundabout
  • Loading branch information
daniel-j-h committed Jun 1, 2016
1 parent 5031372 commit d21919a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions profiles/bicycle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function way_function (way, result)
end

-- roundabout handling
if junction and "roundabout" == junction then
if junction and "roundabout" == junction or "mini_roundabout" == highway then
result.roundabout = true
end

Expand Down Expand Up @@ -285,7 +285,7 @@ function way_function (way, result)
else
-- biking not allowed, maybe we can push our bike?
-- essentially requires pedestrian profiling, for example foot=no mean we can't push a bike
if foot ~= 'no' and junction ~= "roundabout" then
if foot ~= 'no' and junction ~= "roundabout" and highway ~= "mini_roundabout" then
if pedestrian_speeds[highway] then
-- pedestrian-only ways and areas
result.forward_speed = pedestrian_speeds[highway]
Expand Down Expand Up @@ -317,7 +317,7 @@ function way_function (way, result)

-- direction
local impliedOneway = false
if junction == "roundabout" or highway == "motorway_link" or highway == "motorway" then
if junction == "roundabout" or highway == "mini_roundabout" or highway == "motorway_link" or highway == "motorway" then
impliedOneway = true
end

Expand Down Expand Up @@ -357,7 +357,7 @@ function way_function (way, result)

-- pushing bikes
if bicycle_speeds[highway] or pedestrian_speeds[highway] then
if foot ~= "no" and junction ~= "roundabout" then
if foot ~= "no" and junction ~= "roundabout" and highway ~= "mini_roundabout" then
if result.backward_mode == mode.inaccessible then
result.backward_speed = walking_speed
result.backward_mode = mode.pushing_bike
Expand Down
3 changes: 2 additions & 1 deletion profiles/car.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ function way_function (way, result)
-- result.name = highway -- if no name exists, use way type
end

if junction and "roundabout" == junction then
if junction and ("roundabout" == junction or "mini_roundabout" == highway) then
result.roundabout = true
end

Expand All @@ -390,6 +390,7 @@ function way_function (way, result)
oneway == "1" or
oneway == "true" or
junction == "roundabout" or
highway == "mini_roundabout" or
(highway == "motorway_link" and oneway ~="no") or
(highway == "motorway" and oneway ~= "no") then
result.backward_mode = mode.inaccessible
Expand Down
2 changes: 1 addition & 1 deletion profiles/foot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function way_function (way, result)
end

-- roundabouts
if "roundabout" == junction then
if "roundabout" == junction or "mini_roundabout" == highway then
result.roundabout = true
end

Expand Down
4 changes: 2 additions & 2 deletions profiles/testbot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ function way_function (way, result)
-- nothing to do
elseif oneway == "-1" then
result.forward_mode = mode.inaccessible
elseif oneway == "yes" or oneway == "1" or oneway == "true" or junction == "roundabout" then
elseif oneway == "yes" or oneway == "1" or oneway == "true" or junction == "roundabout" or highway == "mini_roundabout" then
result.backward_mode = mode.inaccessible
end

if junction == 'roundabout' then
if junction == 'roundabout' or highway == 'mini_roundabout' then
result.roundabout = true
end
end

0 comments on commit d21919a

Please sign in to comment.