From: Sarah Hoffmann Date: Sat, 23 Nov 2013 15:04:53 +0000 (+0100) Subject: refuse updates of overly complex multipolygons X-Git-Tag: deploy~563 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/85b7ea8eedd7471412f289a7b37b450b6d67f0da refuse updates of overly complex multipolygons --- 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, '')