mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-10 12:04:06 +00:00
when linking waterway ways and relations allow all river-like types
Fixes #848
This commit is contained in:
@@ -1355,7 +1355,7 @@ BEGIN
|
|||||||
--DEBUG: RAISE WARNING 'waterway parent %, child %/%', NEW.osm_id, i, relation_members[i];
|
--DEBUG: RAISE WARNING 'waterway parent %, child %/%', NEW.osm_id, i, relation_members[i];
|
||||||
FOR linked_node_id IN SELECT place_id FROM placex
|
FOR linked_node_id IN SELECT place_id FROM placex
|
||||||
WHERE osm_type = 'W' and osm_id = substring(relation_members[i],2,200)::bigint
|
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')
|
and ( relation_members[i+1] != 'side_stream' or NEW.name->'name' = name->'name')
|
||||||
LOOP
|
LOOP
|
||||||
UPDATE placex SET linked_place_id = NEW.place_id WHERE place_id = linked_node_id;
|
UPDATE placex SET linked_place_id = NEW.place_id WHERE place_id = linked_node_id;
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ Feature: Linking of places
|
|||||||
Scenario: Relations are not linked when in waterway relations
|
Scenario: Relations are not linked when in waterway relations
|
||||||
Given the scene split-road
|
Given the scene split-road
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W1 | waterway | river | Rhein | :w-2 |
|
| W1 | waterway | stream | Rhein | :w-2 |
|
||||||
| W2 | waterway | river | Rhein | :w-3 |
|
| W2 | waterway | river | Rhein | :w-3 |
|
||||||
| R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
|
| R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
|
||||||
| R2 | waterway | river | Limmat| :w-4a |
|
| R2 | waterway | river | Limmat| :w-4a |
|
||||||
And the relations
|
And the relations
|
||||||
| id | members | tags+type |
|
| id | members | tags+type |
|
||||||
| 1 | R2 | waterway |
|
| 1 | R2 | waterway |
|
||||||
@@ -69,11 +69,11 @@ Feature: Linking of places
|
|||||||
| object | linked_place_id |
|
| object | linked_place_id |
|
||||||
| R1 | - |
|
| 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
|
Given the scene split-road
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| 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 |
|
| R1 | waterway | river | Rhein | :w-1 + :w-2 + :w-3 |
|
||||||
And the relations
|
And the relations
|
||||||
| id | members | tags+type |
|
| id | members | tags+type |
|
||||||
|
|||||||
Reference in New Issue
Block a user