From 4423592de01f038daa8a3dd7a1b1d52aca69dce8 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 13 Jul 2012 22:33:09 +0200 Subject: [PATCH] gracefully fail if nodes from an address interpolation are missing --- sql/functions.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sql/functions.sql b/sql/functions.sql index 03ea4011..1d653bb2 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -769,6 +769,13 @@ BEGIN -- null record of right type select * from placex where osm_type = 'N' and osm_id = waynodes[nodeidpos]::INTEGER and type = 'house' limit 1 INTO nextnode; select ST_SetSRID(ST_Point(lon::float/10000000,lat::float/10000000),4326) from planet_osm_nodes where id = waynodes[nodeidpos] INTO nextnode.geometry; + IF nextnode.geometry IS NULL THEN + -- we don't have any information about this point, most likely + -- because an excerpt was updated and the node never imported + -- because the interpolation is outside the region of the excerpt. + -- Give up. + RETURN newpoints; + END IF; ELSE select * from placex where place_id = search_place_id INTO nextnode; END IF; -- 2.39.5