From 85b7ea8eedd7471412f289a7b37b450b6d67f0da Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sat, 23 Nov 2013 16:04:53 +0100 Subject: [PATCH] refuse updates of overly complex multipolygons --- sql/functions.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/functions.sql b/sql/functions.sql index cb4c67e8..05de978e 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -2243,6 +2243,12 @@ BEGIN END IF; + -- refuse to update multiplpoygons with too many objects, too much of a performance hit + IF ST_NumGeometries(NEW.geometry) > 2000 THEN + RAISE WARNING 'Dropping update of % % because of geometry complexity.', NEW.osm_type, NEW.osm_id; + RETURN NULL; + END IF; + IF coalesce(existing.name::text, '') != coalesce(NEW.name::text, '') OR coalesce(existing.extratags::text, '') != coalesce(NEW.extratags::text, '') OR coalesce(existing.housenumber, '') != coalesce(NEW.housenumber, '') -- 2.39.5