Skip to content

Commit

Permalink
allow more ways to be used for street name matching
Browse files Browse the repository at this point in the history
  • Loading branch information
breunigs committed Oct 20, 2024
1 parent ccfacf7 commit 5a472bb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/basemap/mapmatching.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
local bicycle = require('bicycle')
-- allow "push bike" paths for naming, even if bicycle=no
local allowed_despite_bicycle_no = Set { 'path', 'pedestrian', 'service' }

function process_way(profile, way, result)
local name = way:get_value_by_key("name") or way:get_value_by_key("bridge:name")
if name
and way:get_value_by_key("fee") ~= "yes"
and way:get_value_by_key("amenity") ~= "parking" then
and way:get_value_by_key("amenity") ~= "parking"
and (
way:get_value_by_key("bicycle") ~= "no"
or
allowed_despite_bicycle_no[way:get_value_by_key("highway")]
or
-- some ways are tagged bicycle=no cycleway=track, which makes no sense tag
-- wise. Probably an edit error.
way:get_value_by_key("cycleway") ~= ""
) then
result.name = name
bicycle.process_way(profile, way, result)
end
Expand All @@ -22,7 +33,8 @@ function setup()
}

data.access_tag_blacklist = Set {
'no',
-- allow "push bike" paths for naming, even if bicycle=no
-- 'no',
'private',
'forestry',
'delivery',
Expand Down

0 comments on commit 5a472bb

Please sign in to comment.