Add support for annotations=distances in MLD

This commit brings feature parity with CH for the `table` pluging.
This commit is contained in:
Kajari Ghosh
2018-04-07 22:20:59 -04:00
committed by Patrick Niklaus
parent 1a1293608d
commit 2a15e6dec8
13 changed files with 793 additions and 115 deletions
+7 -5
View File
@@ -5,7 +5,7 @@
-- Secondary road: 18km/h = 18000m/3600s = 100m/20s
-- Tertiary road: 12km/h = 12000m/3600s = 100m/30s
api_version = 3
api_version = 4
function setup()
return {
@@ -14,7 +14,7 @@ function setup()
max_speed_for_map_matching = 30/3.6, --km -> m/s
weight_name = 'duration',
process_call_tagless_node = false,
uturn_penalty = 20,
u_turn_penalty = 20,
traffic_light_penalty = 7, -- seconds
use_turn_restrictions = true
},
@@ -128,13 +128,15 @@ function process_way (profile, way, result)
end
function process_turn (profile, turn)
if turn.direction_modifier == direction_modifier.uturn then
turn.duration = profile.properties.uturn_penalty
turn.weight = profile.properties.uturn_penalty
if turn.is_u_turn then
turn.duration = turn.duration + profile.properties.u_turn_penalty
turn.weight = turn.weight + profile.properties.u_turn_penalty
end
if turn.has_traffic_light then
turn.duration = turn.duration + profile.properties.traffic_light_penalty
end
io.write("after penalty turn.duration: ", turn.duration, "turn.weight: ", turn.weight, "\n")
end
return {