abort osmline update correctly when way nodes are missing

Fixes #695.
This commit is contained in:
Sarah Hoffmann
2017-03-30 22:14:47 +02:00
parent ee1b25820e
commit 43eedfd253
2 changed files with 18 additions and 1 deletions

View File

@@ -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;

View File

@@ -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