From d68a6a4942d27d820c2ce31e122b896ccbb4d1db Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 4 Jan 2020 21:29:55 +0100 Subject: [PATCH] raise warning when invalid geomery is inserted Enabled to check the logs if this case still happens. It shouldn't. --- sql/functions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/functions.sql b/sql/functions.sql index 5d2b7a22..43ab4fff 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -2020,7 +2020,7 @@ BEGIN IF ST_IsEmpty(NEW.geometry) OR NOT ST_IsValid(NEW.geometry) OR ST_X(ST_Centroid(NEW.geometry))::text in ('NaN','Infinity','-Infinity') OR ST_Y(ST_Centroid(NEW.geometry))::text in ('NaN','Infinity','-Infinity') THEN INSERT INTO import_polygon_error (osm_type, osm_id, class, type, name, country_code, updated, errormessage, prevgeometry, newgeometry) VALUES (NEW.osm_type, NEW.osm_id, NEW.class, NEW.type, NEW.name, NEW.address->'country', now(), ST_IsValidReason(NEW.geometry), null, NEW.geometry); --- RAISE WARNING 'Invalid Geometry: % % % %',NEW.osm_type,NEW.osm_id,NEW.class,NEW.type; + RAISE WARNING 'Invalid Geometry: % % % %',NEW.osm_type,NEW.osm_id,NEW.class,NEW.type; RETURN null; END IF; -- 2.45.2