Makes toll=yes way's routability configurable in profiles.
The primary use-case is conditionally filtering ways such as: https://www.openstreetmap.org/edit#map=18/38.94198/-77.28127 which we are guiding the user onto in the route from DC to IAD: http://map.project-osrm.org/?z=12¢er=38.934443%2C-77.167969&loc=38.902656%2C-77.029095&loc=38.952210%2C-77.453424&hl=en&alt=0 This changeset makes `toll=yes` configurable in the profiles, disabling them by default. Neither do we support time-based fees nor vehicle category fees at the moment. References: - http://wiki.openstreetmap.org/wiki/Key:toll
This commit is contained in:
@@ -149,6 +149,7 @@ local turn_bias = 1.2
|
||||
local obey_oneway = true
|
||||
local ignore_areas = true
|
||||
local ignore_hov_ways = true
|
||||
local ignore_toll_ways = true
|
||||
|
||||
local abs = math.abs
|
||||
local min = math.min
|
||||
@@ -240,6 +241,12 @@ function way_function (way, result)
|
||||
return
|
||||
end
|
||||
|
||||
-- respect user-preference for toll=yes ways
|
||||
local toll = way:get_value_by_key("toll")
|
||||
if ignore_toll_ways and toll and "yes" == toll then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if oneway tag is unsupported
|
||||
local oneway = way:get_value_by_key("oneway")
|
||||
if oneway and "reversible" == oneway then
|
||||
|
||||
Reference in New Issue
Block a user