Remove unneeded semicola from profiles.

Nothing fancy, does what it says.
This commit is contained in:
Daniel J. Hofmann 2015-09-02 12:23:26 +02:00
parent f6a90e9b42
commit bb1428eeb1
4 changed files with 19 additions and 19 deletions

View File

@ -120,7 +120,7 @@ local function parse_maxspeed(source)
n = 0
end
if string.match(source, "mph") or string.match(source, "mp/h") then
n = (n*1609)/1000;
n = (n*1609)/1000
end
return n
end
@ -155,7 +155,7 @@ function node_function (node, result)
-- check if node is a traffic light
local tag = node:get_value_by_key("highway")
if tag and "traffic_signals" == tag then
result.traffic_lights = true;
result.traffic_lights = true
end
end
@ -226,15 +226,15 @@ function way_function (way, result)
-- roundabout handling
if junction and "roundabout" == junction then
result.roundabout = true;
result.roundabout = true
end
-- speed
local bridge_speed = bridge_speeds[bridge]
if (bridge_speed and bridge_speed > 0) then
highway = bridge;
highway = bridge
if duration and durationIsValid(duration) then
result.duration = math.max( parseDuration(duration), 1 );
result.duration = math.max( parseDuration(duration), 1 )
end
result.forward_mode = mode_movable_bridge
result.backward_mode = mode_movable_bridge

View File

@ -159,7 +159,7 @@ local function parse_maxspeed(source)
local n = tonumber(source:match("%d*"))
if n then
if string.match(source, "mph") or string.match(source, "mp/h") then
n = (n*1609)/1000;
n = (n*1609)/1000
end
else
-- parse maxspeed like FR:urban
@ -208,7 +208,7 @@ function node_function (node, result)
-- check if node is a traffic light
local tag = node:get_value_by_key("highway")
if tag and "traffic_signals" == tag then
result.traffic_lights = true;
result.traffic_lights = true
end
end
@ -252,10 +252,10 @@ function way_function (way, result)
-- handling ferries and piers
local route_speed = speed_profile[route]
if (route_speed and route_speed > 0) then
highway = route;
highway = route
local duration = way:get_value_by_key("duration")
if duration and durationIsValid(duration) then
result.duration = max( parseDuration(duration), 1 );
result.duration = max( parseDuration(duration), 1 )
end
result.forward_mode = mode_ferry
result.backward_mode = mode_ferry
@ -267,10 +267,10 @@ function way_function (way, result)
local bridge_speed = speed_profile[bridge]
local capacity_car = way:get_value_by_key("capacity:car")
if (bridge_speed and bridge_speed > 0) and (capacity_car ~= 0) then
highway = bridge;
highway = bridge
local duration = way:get_value_by_key("duration")
if duration and durationIsValid(duration) then
result.duration = max( parseDuration(duration), 1 );
result.duration = max( parseDuration(duration), 1 )
end
result.forward_mode = mode_movable_bridge
result.backward_mode = mode_movable_bridge
@ -355,7 +355,7 @@ function way_function (way, result)
end
if junction and "roundabout" == junction then
result.roundabout = true;
result.roundabout = true
end
-- Set access restriction flag if access is allowed under certain restrictions only
@ -413,19 +413,19 @@ function way_function (way, result)
-- scale speeds to get better avg driving times
if result.forward_speed > 0 then
local scaled_speed = result.forward_speed*speed_reduction + 11;
local scaled_speed = result.forward_speed*speed_reduction + 11
local penalized_speed = math.huge
if width <= 3 or (lanes <= 1 and is_bidirectional) then
penalized_speed = result.forward_speed / 2;
penalized_speed = result.forward_speed / 2
end
result.forward_speed = math.min(penalized_speed, scaled_speed)
end
if result.backward_speed > 0 then
local scaled_speed = result.backward_speed*speed_reduction + 11;
local scaled_speed = result.backward_speed*speed_reduction + 11
local penalized_speed = math.huge
if width <= 3 or (lanes <= 1 and is_bidirectional) then
penalized_speed = result.backward_speed / 2;
penalized_speed = result.backward_speed / 2
end
result.backward_speed = math.min(penalized_speed, scaled_speed)
end

View File

@ -161,7 +161,7 @@ function way_function (way, result)
-- roundabouts
if "roundabout" == junction then
result.roundabout = true;
result.roundabout = true
end
-- speed

View File

@ -49,7 +49,7 @@ function node_function (node, result)
local traffic_signal = node:get_value_by_key("highway")
if traffic_signal and traffic_signal == "traffic_signals" then
result.traffic_lights = true;
result.traffic_lights = true
-- TODO: a way to set the penalty value
end
end
@ -78,7 +78,7 @@ function way_function (way, result)
local speed_back = speed_forw
if highway == "river" then
local temp_speed = speed_forw;
local temp_speed = speed_forw
result.forward_mode = 3
result.backward_mode = 4
speed_forw = temp_speed*1.5