]> git.openstreetmap.org Git - nominatim.git/commitdiff
refuse updates of overly complex multipolygons
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 23 Nov 2013 15:04:53 +0000 (16:04 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 23 Nov 2013 15:04:53 +0000 (16:04 +0100)
sql/functions.sql

index cb4c67e8d8c2525a127f880aa8c7c881bf47f2ed..05de978ec415a6e3c594ad6eaaec470ea4e042eb 100644 (file)
@@ -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, '')