bringing bikes on trains
This commit is contained in:
parent
599b96ed95
commit
c83ab666d7
@ -7,17 +7,26 @@ Bringing bikes on trains and subways
|
|||||||
|
|
||||||
Scenario: Bike - Bringing bikes on trains
|
Scenario: Bike - Bringing bikes on trains
|
||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | railway | bicycle | bothw |
|
| highway | railway | bicycle | bothw |
|
||||||
| primary | | | x |
|
| primary | | | x |
|
||||||
| (nil) | train | | |
|
| (nil) | train | | |
|
||||||
| (nil) | train | no | |
|
| (nil) | train | no | |
|
||||||
| (nil) | train | yes | x |
|
| (nil) | train | yes | x |
|
||||||
| (nil) | railway | | |
|
| (nil) | railway | | |
|
||||||
| (nil) | railway | no | |
|
| (nil) | railway | no | |
|
||||||
| (nil) | railway | yes | x |
|
| (nil) | railway | yes | x |
|
||||||
| (nil) | subway | | |
|
| (nil) | subway | | |
|
||||||
| (nil) | subway | no | |
|
| (nil) | subway | no | |
|
||||||
| (nil) | subway | yes | x |
|
| (nil) | subway | yes | x |
|
||||||
| (nil) | some_tag | | |
|
| (nil) | tram | | |
|
||||||
| (nil) | some_tag | no | |
|
| (nil) | tram | no | |
|
||||||
| (nil) | some_tag | yes | x |
|
| (nil) | tram | yes | x |
|
||||||
|
| (nil) | light_rail | | |
|
||||||
|
| (nil) | light_rail | no | |
|
||||||
|
| (nil) | light_rail | yes | x |
|
||||||
|
| (nil) | monorail | | |
|
||||||
|
| (nil) | monorail | no | |
|
||||||
|
| (nil) | monorail | yes | x |
|
||||||
|
| (nil) | some_tag | | |
|
||||||
|
| (nil) | some_tag | no | |
|
||||||
|
| (nil) | some_tag | yes | x |
|
||||||
|
@ -28,7 +28,13 @@ speed_profile = {
|
|||||||
["pier"] = 5,
|
["pier"] = 5,
|
||||||
["steps"] = 1,
|
["steps"] = 1,
|
||||||
["default"] = 18,
|
["default"] = 18,
|
||||||
["ferry"] = 5
|
["ferry"] = 5,
|
||||||
|
["train"] = 80,
|
||||||
|
["railway"] = 60,
|
||||||
|
["subway"] = 50,
|
||||||
|
["light_rail"] = 40,
|
||||||
|
["monorail"] = 40,
|
||||||
|
["tram"] = 40
|
||||||
}
|
}
|
||||||
|
|
||||||
take_minimum_of_speeds = true
|
take_minimum_of_speeds = true
|
||||||
@ -92,6 +98,7 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
local ref = way.tags:Find("ref")
|
local ref = way.tags:Find("ref")
|
||||||
local junction = way.tags:Find("junction")
|
local junction = way.tags:Find("junction")
|
||||||
local route = way.tags:Find("route")
|
local route = way.tags:Find("route")
|
||||||
|
local railway = way.tags:Find("railway")
|
||||||
local maxspeed = parseMaxspeed(way.tags:Find ( "maxspeed") )
|
local maxspeed = parseMaxspeed(way.tags:Find ( "maxspeed") )
|
||||||
local man_made = way.tags:Find("man_made")
|
local man_made = way.tags:Find("man_made")
|
||||||
local barrier = way.tags:Find("barrier")
|
local barrier = way.tags:Find("barrier")
|
||||||
@ -106,7 +113,7 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
local access = find_access_tag(way)
|
local access = find_access_tag(way)
|
||||||
|
|
||||||
-- only route on things with highway tag set (not buildings, boundaries, etc)
|
-- only route on things with highway tag set (not buildings, boundaries, etc)
|
||||||
if (not highway or highway == '') and (not route or route == '') then
|
if (not highway or highway == '') and (not route or route == '') and (not railway or railway=='') then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -139,7 +146,13 @@ function way_function (way, numberOfNodesInWay)
|
|||||||
if not way.is_duration_set then
|
if not way.is_duration_set then
|
||||||
way.speed = speed_profile[highway]
|
way.speed = speed_profile[highway]
|
||||||
end
|
end
|
||||||
else
|
elseif railway and speed_profile[railway] then
|
||||||
|
-- trains and subways
|
||||||
|
if access and access_tag_whitelist[access] then
|
||||||
|
way.speed = speed_profile[railway]
|
||||||
|
way.direction = Way.bidirectional
|
||||||
|
end
|
||||||
|
else
|
||||||
-- ways
|
-- ways
|
||||||
if speed_profile[highway] then
|
if speed_profile[highway] then
|
||||||
way.speed = speed_profile[highway]
|
way.speed = speed_profile[highway]
|
||||||
|
Loading…
Reference in New Issue
Block a user