Normalizes spaces in profiles

This commit is contained in:
Daniel J. Hofmann 2017-07-19 15:32:42 +02:00 committed by Patrick Niklaus
parent ababeb3a69
commit 48824c4c8a
3 changed files with 40 additions and 40 deletions

View File

@ -53,17 +53,17 @@ function setup()
}, },
access_tag_whitelist = Set { access_tag_whitelist = Set {
'yes', 'yes',
'permissive', 'permissive',
'designated' 'designated'
}, },
access_tag_blacklist = Set { access_tag_blacklist = Set {
'no', 'no',
'private', 'private',
'agricultural', 'agricultural',
'forestry', 'forestry',
'delivery' 'delivery'
}, },
restricted_access_tag_list = Set { }, restricted_access_tag_list = Set { },
@ -71,24 +71,24 @@ function setup()
restricted_highway_whitelist = Set { }, restricted_highway_whitelist = Set { },
access_tags_hierarchy = Sequence { access_tags_hierarchy = Sequence {
'bicycle', 'bicycle',
'vehicle', 'vehicle',
'access' 'access'
}, },
restrictions = Set { restrictions = Set {
'bicycle' 'bicycle'
}, },
cycleway_tags = Set { cycleway_tags = Set {
'track', 'track',
'lane', 'lane',
'opposite', 'opposite',
'opposite_lane', 'opposite_lane',
'opposite_track', 'opposite_track',
'share_busway', 'share_busway',
'sharrow', 'sharrow',
'shared', 'shared',
'shared_lane' 'shared_lane'
}, },
@ -206,7 +206,7 @@ local function parse_maxspeed(source)
return n return n
end end
function process_node (profile, node, result) function process_node(profile, node, result)
-- parse access and barrier tags -- parse access and barrier tags
local highway = node:get_value_by_key("highway") local highway = node:get_value_by_key("highway")
local is_crossing = highway and highway == "crossing" local is_crossing = highway and highway == "crossing"
@ -493,7 +493,7 @@ function handle_bicycle_tags(profile,way,result,data)
end end
end end
end end
function process_way (profile, way, result) function process_way(profile, way, result)
-- the initial filtering of ways based on presence of tags -- the initial filtering of ways based on presence of tags
-- affects processing times significantly, because all ways -- affects processing times significantly, because all ways
-- have to be checked. -- have to be checked.

View File

@ -26,7 +26,7 @@ function setup()
use_turn_restrictions = true, use_turn_restrictions = true,
traffic_light_penalty = 2, traffic_light_penalty = 2,
}, },
default_mode = mode.driving, default_mode = mode.driving,
default_speed = 10, default_speed = 10,
oneway_handling = true, oneway_handling = true,
@ -140,19 +140,19 @@ function setup()
["drive-thru"] = 0.5 ["drive-thru"] = 0.5
}, },
restricted_highway_whitelist = Set { restricted_highway_whitelist = Set {
'motorway', 'motorway',
'motorway_link', 'motorway_link',
'trunk', 'trunk',
'trunk_link', 'trunk_link',
'primary', 'primary',
'primary_link', 'primary_link',
'secondary', 'secondary',
'secondary_link', 'secondary_link',
'tertiary', 'tertiary',
'tertiary_link', 'tertiary_link',
'residential', 'residential',
'living_street', 'living_street',
}, },
route_speeds = { route_speeds = {
@ -262,7 +262,7 @@ function setup()
} }
end end
function process_node (profile, node, result) function process_node(profile, node, result)
-- parse access and barrier tags -- parse access and barrier tags
local access = find_access_tag(node, profile.access_tags_hierarchy) local access = find_access_tag(node, profile.access_tags_hierarchy)
if access then if access then
@ -375,7 +375,7 @@ function process_way(profile, way, result)
WayHandlers.run(profile,way,result,data,handlers) WayHandlers.run(profile,way,result,data,handlers)
end end
function process_turn (profile, turn) function process_turn(profile, turn)
-- Use a sigmoid function to return a penalty that maxes out at turn_penalty -- Use a sigmoid function to return a penalty that maxes out at turn_penalty
-- over the space of 0-180 degrees. Values here were chosen by fitting -- over the space of 0-180 degrees. Values here were chosen by fitting
-- the function to some turn penalty samples from real driving. -- the function to some turn penalty samples from real driving.
@ -404,7 +404,7 @@ function process_turn (profile, turn)
else else
turn.weight = turn.duration turn.weight = turn.duration
end end
if profile.properties.weight_name == 'routability' then if profile.properties.weight_name == 'routability' then
-- penalize turns from non-local access only segments onto local access only tags -- penalize turns from non-local access only segments onto local access only tags
if not turn.source_restricted and turn.target_restricted then if not turn.source_restricted and turn.target_restricted then

View File

@ -137,7 +137,7 @@ function setup()
} }
end end
function process_node (profile, node, result) function process_node(profile, node, result)
-- parse access and barrier tags -- parse access and barrier tags
local access = find_access_tag(node, profile.access_tags_hierarchy) local access = find_access_tag(node, profile.access_tags_hierarchy)
if access then if access then