Skip to content
Snippets Groups Projects
Commit 14e550f7 authored by Alain ANDRE's avatar Alain ANDRE Committed by Alain ANDRÉ
Browse files

Apply penalties after speed reduction

parent 0e9f2328
Branches car-interurban
Tags car-interurban-v5.21.0.2
No related merge requests found
......@@ -434,7 +434,6 @@ function process_way(profile, way, result, relations)
WayHandlers.speed,
WayHandlers.surface,
WayHandlers.maxspeed,
WayHandlers.penalties,
-- compute class labels
WayHandlers.classes,
......@@ -442,6 +441,7 @@ function process_way(profile, way, result, relations)
-- set penalties after setting classes with urban density
Mapotempo.penalties,
WayHandlers.penalties,
-- handle turn lanes and road classification, used for guidance
WayHandlers.turn_lanes,
......
......@@ -68,10 +68,12 @@ function Mapotempo.penalties(profile,way,result,data)
-- decrease speed only some way types (unclassified, residential, living_street)
if width <= 3 or (lanes <= 1 and is_bidirectional) then
if (result.forward_classes["w1"] == false and result.forward_classes["w2"] == true and result.forward_classes["w3"] == true) then
if result.forward_classes["l1"] == false and result.forward_classes["l2"] == false and
(result.forward_classes["w1"] == false and result.forward_classes["w2"] == true and result.forward_classes["w3"] == true) then
result.forward_speed = result.forward_speed / 2
end
if (result.backward_classes["w1"] == false and result.backward_classes["w2"] == true and result.backward_classes["w3"] == true) then
if result.backward_classes["l1"] == false and result.backward_classes["l2"] == false and
(result.backward_classes["w1"] == false and result.backward_classes["w2"] == true and result.backward_classes["w3"] == true) then
result.backward_speed = result.backward_speed / 2
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment