From: Sarah Hoffmann Date: Fri, 29 Jun 2012 20:11:40 +0000 (+0200) Subject: make sure invalid geometries are always deleted from place X-Git-Tag: v2.0.0~52 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/8ff0aabaf3e82e6bc99894e22d312ccc4b76529f make sure invalid geometries are always deleted from place This solves a bug with updating large invalid geometries. These geometries have an entry in place but not in placex. Thus, place_insert tries to delete the place entry and reinsert it on update. Deletion would fail because self-intersecting polygons still have an area and large areas are not deleted. --- diff --git a/sql/functions.sql b/sql/functions.sql index 20e97c1c..03ea4011 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1806,8 +1806,8 @@ BEGIN --DEBUG: RAISE WARNING 'delete: % % % %',OLD.osm_type,OLD.osm_id,OLD.class,OLD.type; - -- deleting large polygons can have a massive effect ont he system - require manual intervention to let them through - IF st_area(OLD.geometry) > 2 THEN + -- deleting large polygons can have a massive effect on the system - require manual intervention to let them through + IF st_area(OLD.geometry) > 2 and st_isvalid(OLD.geometry) THEN insert into import_polygon_delete values (OLD.osm_type,OLD.osm_id,OLD.class,OLD.type); RETURN NULL; END IF;