prefer ways on route=bicycle
This commit is contained in:
parent
076c8b6dab
commit
068e240739
@ -32,6 +32,7 @@ function setup()
|
|||||||
turn_penalty = 6,
|
turn_penalty = 6,
|
||||||
turn_bias = 1.4,
|
turn_bias = 1.4,
|
||||||
use_public_transport = true,
|
use_public_transport = true,
|
||||||
|
route_preference = 1.1,
|
||||||
|
|
||||||
allowed_start_modes = Set {
|
allowed_start_modes = Set {
|
||||||
mode.cycling,
|
mode.cycling,
|
||||||
@ -314,6 +315,7 @@ function handle_bicycle_tags(profile,way,result,data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
safety_handler(profile,way,result,data)
|
safety_handler(profile,way,result,data)
|
||||||
|
bicycle_relation_handler(profile,way,result,data,relations)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -454,6 +456,16 @@ function cycleway_handler(profile,way,result,data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function bicycle_relation_handler(profile,way,result,data,relations)
|
||||||
|
-- prefer ways on route=bicycle by factor of profile.route_preference
|
||||||
|
if result.forward_rate and Relations.filter_relations(relations, way, "route", "bicycle", "route", "forward") == "bicycle" then
|
||||||
|
result.forward_rate = result.forward_rate * profile.route_preference
|
||||||
|
end
|
||||||
|
if result.backward_rate and Relations.filter_relations(relations, way, "route", "bicycle", "route", "backward") == "bicycle" then
|
||||||
|
result.backward_rate = result.backward_rate * profile.route_preference
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function bike_push_handler(profile,way,result,data)
|
function bike_push_handler(profile,way,result,data)
|
||||||
-- pushing bikes - if no other mode found
|
-- pushing bikes - if no other mode found
|
||||||
if result.forward_mode == mode.inaccessible or result.backward_mode == mode.inaccessible or
|
if result.forward_mode == mode.inaccessible or result.backward_mode == mode.inaccessible or
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user