]> git.openstreetmap.org Git - nominatim.git/commitdiff
exclude sidewalks and similar footways
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 9 Dec 2024 15:34:18 +0000 (16:34 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 16 Dec 2024 09:26:55 +0000 (10:26 +0100)
These footways are part of a street that is usually already named.

lib-lua/themes/nominatim/presets.lua
test/bdd/osm2pgsql/import/tags.feature

index fbc9aab1bf3f2afa0d53b843e6eb8be3225dc217..d8aa75340251f1c583e3a3906829d4f6976eea41 100644 (file)
@@ -2,6 +2,20 @@
 
 local module = {}
 
+-- Customized main tag filter functions
+
+local EXCLUDED_FOOTWAYS = { sidewalk = 1, crossing = 1, link = 1, traffic_aisle }
+
+local function filter_footways(place)
+    if place.has_name then
+        local footway = place.object.tags.footway
+        if footway == nil or EXCLUDED_FOOTWAYS[footway] ~= 1 then
+            return place
+        end
+    end
+    return false
+end
+
 -- Main tag definition
 
 module.MAIN_TAGS = {}
@@ -156,7 +170,7 @@ module.MAIN_TAGS_STREETS.default = {
                service = 'named',
                cycleway = 'named',
                path = 'named',
-               footway = 'named',
+               footway = filter_footways,
                steps = 'named',
                bridleway = 'named',
                track = 'named',
index cf530eb7d9ce5e81f685b6a03d369b3e789df55c..948ffe84183b10bf042ff951f3528d6cc38c11a3 100644 (file)
@@ -206,3 +206,20 @@ Feature: Tag evaluation
             | object | class | type   | address                 |
             | N13001 | place | houses | 'interpolation': 'odd'  |
             | N13002 | place | houses | 'interpolation': 'even' |
+
+
+    Scenario: Footways
+        When loading osm data
+            """
+            n1 x0.0 y0.0
+            n2 x0 y0.0001
+            w1 Thighway=footway Nn1,n2
+            w2 Thighway=footway,name=Road Nn1,n2
+            w3 Thighway=footway,name=Road,footway=sidewalk Nn1,n2
+            w4 Thighway=footway,name=Road,footway=crossing Nn1,n2
+            w5 Thighway=footway,name=Road,footway=residential Nn1,n2
+            """
+        Then place contains exactly
+            | object | name+name |
+            | W2     | Road      |
+            | W5     | Road      |