diff --git a/profiles/bicycle.lua b/profiles/bicycle.lua index c87baad33..12c4a9484 100644 --- a/profiles/bicycle.lua +++ b/profiles/bicycle.lua @@ -65,6 +65,24 @@ route_speeds = { ["ferry"] = 5 } +surface_speeds = { + ["cobblestone:flattened"] = 10, + ["paving_stones"] = 10, + ["compacted"] = 10, + ["cobblestone"] = 6, + ["unpaved"] = 6, + ["fine_gravel"] = 6, + ["gravel"] = 6, + ["fine_gravel"] = 6, + ["pebbelstone"] = 6, + ["ground"] = 6, + ["dirt"] = 6, + ["earth"] = 6, + ["grass"] = 6, + ["mud"] = 3, + ["sand"] = 3 +} + take_minimum_of_speeds = true obey_oneway = true obey_bollards = false @@ -158,6 +176,7 @@ function way_function (way) local service = way.tags:Find("service") local area = way.tags:Find("area") local foot = way.tags:Find("foot") + local surface = way.tags:Find("surface") -- name if "" ~= ref then @@ -286,6 +305,15 @@ function way_function (way) elseif cycleway_right and cycleway_tags[cycleway_right] then way.speed = bicycle_speeds["cycleway"] end + + -- surfaces + if surface then + surface_speed = surface_speeds[surface] + if surface_speed then + way.speed = math.min(way.speed, surface_speed) + way.backward_speed = math.min(way.backward_speed, surface_speed) + end + end -- maxspeed -- TODO: maxspeed of backward direction