remove calls to handlers now in handle_penalties
This commit is contained in:
committed by
Patrick Niklaus
parent
46f96af360
commit
25ab51f4f0
+3
-5
@@ -17,7 +17,7 @@ properties.max_speed_for_map_matching = 180/3.6 -- 180kmph -> m/s
|
||||
properties.use_turn_restrictions = true
|
||||
properties.continue_straight_at_waypoint = true
|
||||
properties.left_hand_driving = false
|
||||
-- For routing based on duration, but weighted for prefering certain roads
|
||||
-- For routing based on duration, but weighted for preferring certain roads
|
||||
properties.weight_name = 'routability'
|
||||
-- For shortest duration without penalties for accessibility
|
||||
--properties.weight_name = 'duration'
|
||||
@@ -316,10 +316,10 @@ function way_function(way, result)
|
||||
-- access tags, e.g: motorcar, motor_vehicle, vehicle
|
||||
'handle_access',
|
||||
|
||||
-- check whether forward/backward directons are routable
|
||||
-- check whether forward/backward directions are routable
|
||||
'handle_oneway',
|
||||
|
||||
-- check whether forward/backward directons are routable
|
||||
-- check whether forward/backward directions are routable
|
||||
'handle_destinations',
|
||||
|
||||
-- check whether we're using a special transport mode
|
||||
@@ -334,11 +334,9 @@ function way_function(way, result)
|
||||
|
||||
-- compute speed taking into account way type, maxspeed tags, etc.
|
||||
'handle_speed',
|
||||
'handle_side_roads',
|
||||
'handle_surface',
|
||||
'handle_maxspeed',
|
||||
'handle_penalties',
|
||||
'handle_alternating_speed',
|
||||
|
||||
-- handle turn lanes and road classification, used for guidance
|
||||
'handle_turn_lanes',
|
||||
|
||||
@@ -305,17 +305,17 @@ function Handlers.handle_penalties(way,result,data,profile)
|
||||
local sideroad_penalty = 1.0
|
||||
data.sideroad = way:get_value_by_key("side_road")
|
||||
if "yes" == data.sideroad or "rotary" == data.sideroad then
|
||||
sideroad_penalty = side_road_multipler;
|
||||
sideroad_penalty = side_road_multiplier;
|
||||
end
|
||||
|
||||
local penalty = service_penalty * width_penalty * alternating_penalty * sideroad_penalty
|
||||
|
||||
if properties.weight_name == 'routability' then
|
||||
if result.forward_speed > 0 then
|
||||
result.forward_rate = result.forward_speed * penalty
|
||||
result.forward_rate = result.forward_speed * profile.speed_reduction
|
||||
end
|
||||
if result.backward_speed > 0 then
|
||||
result.backward_rate = result.backward_speed * penalty
|
||||
result.backward_rate = result.backward_speed * profile.speed_reduction
|
||||
end
|
||||
if result.duration > 0 then
|
||||
result.weight = result.duration / penalty
|
||||
@@ -331,11 +331,11 @@ function Handlers.handle_maxspeed(way,result,data,profile)
|
||||
backward = Handlers.parse_maxspeed(backward,profile)
|
||||
|
||||
if forward and forward > 0 then
|
||||
result.forward_speed = forward * speed_scaling
|
||||
result.forward_speed = forward * profile.speed_reduction
|
||||
end
|
||||
|
||||
if backward and backward > 0 then
|
||||
result.backward_speed = backward * speed_scaling
|
||||
result.backward_speed = backward * profile.speed_reduction
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user