]> git.openstreetmap.org Git - nominatim.git/commitdiff
when linking waterway ways and relations allow all river-like types
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 16 Dec 2017 15:59:48 +0000 (16:59 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 16 Dec 2017 16:00:55 +0000 (17:00 +0100)
Fixes #848

sql/functions.sql
test/bdd/db/import/linking.feature

index 1691e23573cef829c0d788298708e66775189b68..58d3fc7de7e78f8962c38bb3269c722864205d19 100644 (file)
@@ -1355,7 +1355,7 @@ BEGIN
                 --DEBUG: RAISE WARNING 'waterway parent %, child %/%', NEW.osm_id, i, relation_members[i];
                 FOR linked_node_id IN SELECT place_id FROM placex
                   WHERE osm_type = 'W' and osm_id = substring(relation_members[i],2,200)::bigint
-                  and class = NEW.class and type = NEW.type
+                  and class = NEW.class and type in ('river', 'stream', 'canal', 'drain', 'ditch')
                   and ( relation_members[i+1] != 'side_stream' or NEW.name->'name' = name->'name')
                 LOOP
                   UPDATE placex SET linked_place_id = NEW.place_id WHERE place_id = linked_node_id;
index ecb1c9dff62fe7628b4e52e1a05118303c0d3ddb..ceb455865a776875a56b1c3e4fcbb315d17d4378 100644 (file)
@@ -40,11 +40,11 @@ Feature: Linking of places
     Scenario: Relations are not linked when in waterway relations
         Given the scene split-road
         And the places
-         | osm | class    | type  | name  | geometry |
-         | W1  | waterway | river | Rhein | :w-2 |
-         | W2  | waterway | river | Rhein | :w-3 |
-         | R1  | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
-         | R2  | waterway | river | Limmat| :w-4a |
+         | osm | class    | type   | name  | geometry |
+         | W1  | waterway | stream | Rhein | :w-2 |
+         | W2  | waterway | river  | Rhein | :w-3 |
+         | R1  | waterway | river  | Rhein | :w-1 + :w-2 + :w-3 |
+         | R2  | waterway | river  | Limmat| :w-4a |
         And the relations
          | id | members                          | tags+type |
          | 1  | R2                               | waterway  |
@@ -69,11 +69,11 @@ Feature: Linking of places
          | object | linked_place_id |
          | R1     | - |
 
-    Scenario: Waterways are not linked when waterway types don't match
+    Scenario: Waterways are not linked when the way type is not a river feature
         Given the scene split-road
         And the places
          | osm | class    | type     | name  | geometry |
-         | W1  | waterway | drain    | Rhein | :w-2 |
+         | W1  | waterway | lock     | Rhein | :w-2 |
          | R1  | waterway | river    | Rhein | :w-1 + :w-2 + :w-3 |
         And the relations
          | id | members               | tags+type |