From: Sarah Hoffmann Date: Thu, 30 Mar 2017 20:14:47 +0000 (+0200) Subject: abort osmline update correctly when way nodes are missing X-Git-Tag: v3.0.0~44 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/43eedfd25371f9c50a2418ee6de0435b4469a85c?hp=-c abort osmline update correctly when way nodes are missing Fixes #695. --- 43eedfd25371f9c50a2418ee6de0435b4469a85c diff --git a/sql/functions.sql b/sql/functions.sql index be67cf01..e6938866 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1026,7 +1026,7 @@ BEGIN select nodes from planet_osm_ways where id = NEW.osm_id INTO waynodes; IF array_upper(waynodes, 1) IS NULL THEN - RETURN 0; + RETURN NEW; END IF; linegeo := NEW.linegeo; diff --git a/test/bdd/db/import/interpolation.feature b/test/bdd/db/import/interpolation.feature index 4ed66b91..7dfc6b23 100644 --- a/test/bdd/db/import/interpolation.feature +++ b/test/bdd/db/import/interpolation.feature @@ -301,3 +301,20 @@ Feature: Import of address interpolations Then W1 expands to interpolation | start | end | geometry | | 23 | 29 | 0.0001 0.0001, 0.0001 0.0002, 0.0001 0.0004 | + + Scenario: Ways without node entries are ignored + Given the places + | osm | class | type | housenr | geometry | + | W1 | place | houses | even | 1 1, 1 1.001 | + When importing + Then W1 expands to no interpolation + + Scenario: Ways without nodes without housenumbers are ignored + Given the places + | osm | class | type | housenr | geometry | + | N1 | place | house | | 1 1 | + | N2 | place | house | | 1 1.001 | + | W1 | place | houses | even | 1 1, 1 1.001 | + When importing + Then W1 expands to no interpolation +