refactor foot profile (as was done for car)

This commit is contained in:
Emil Tin
2017-01-23 08:54:05 +01:00
committed by Daniel J. H
parent b5e289adc3
commit 47b1a56b12
3 changed files with 478 additions and 169 deletions
+33
View File
@@ -56,4 +56,37 @@ function Directional.get_values_by_set(way,data,keys)
return forward, backward
end
-- look through a sequence of keys combined with a prefix
-- e.g. for the sequence [motorcar,motor_vehicle,vehicle] and the prefix 'oneway' search for:
-- oneway:motorcar
-- oneway:motor_vehicle
-- oneway:vehicle
function Directional.get_value_by_prefixed_sequence(way,seq,prefix)
local v
for i,key in ipairs(seq) do
v = way:get_value_by_key(prefix .. ':' .. key)
if v then
return v
end
end
end
-- look through a sequence of keys combined with a postfix
-- e.g. for the sequence [motorcar,motor_vehicle,vehicle] and the postfix 'oneway' search for:
-- motorcar:oneway
-- motor_vehicle:oneway
-- vehicle:oneway
function Directional.get_value_by_postfixed_sequence(way,seq,postfix)
local v
for i,key in ipairs(seq) do
v = way:get_value_by_key(key .. ':' .. postfix)
if v then
return v
end
end
end
return Directional