]> git.openstreetmap.org Git - nominatim.git/commitdiff
do not block deletion of large highway areas
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 28 Aug 2020 07:49:21 +0000 (09:49 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 28 Aug 2020 07:49:21 +0000 (09:49 +0200)
Deletion of areas should only e blocked for addressable features.
Streets and POIs do not have a large impact on updates.

sql/functions/place_triggers.sql
test/bdd/db/update/simple.feature

index 71f918c544d0d2c21828cd3d149c70b9bd201b2f..b7b51150dcf6269fc05d631142789b02583c05e8 100644 (file)
@@ -262,7 +262,7 @@ BEGIN
 
   -- 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
 
   -- 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
-    SELECT bool_or(not (rank_address = 0 or rank_address > 26)) as ranked FROM placex WHERE osm_type = OLD.osm_type and osm_id = OLD.osm_id and class = OLD.class and type = OLD.type INTO has_rank;
+    SELECT bool_or(not (rank_address = 0 or rank_address > 25)) as ranked FROM placex WHERE osm_type = OLD.osm_type and osm_id = OLD.osm_id and class = OLD.class and type = OLD.type INTO has_rank;
     IF has_rank THEN
       insert into import_polygon_delete (osm_type, osm_id, class, type) values (OLD.osm_type,OLD.osm_id,OLD.class,OLD.type);
       RETURN NULL;
     IF has_rank THEN
       insert into import_polygon_delete (osm_type, osm_id, class, type) values (OLD.osm_type,OLD.osm_id,OLD.class,OLD.type);
       RETURN NULL;
index 195d101e1485b56dda71f1d8788c1705cdeafcef..93fb0c00a77fd6449de4e6ea231df5cc1ed30f4d 100644 (file)
@@ -31,14 +31,17 @@ Feature: Update of simple objects
           | osm | class    | type          | geometry |
           | W1  | place    | house         | poly-area:5.0 |
           | R1  | boundary | national_park | poly-area:5.0 |
           | osm | class    | type          | geometry |
           | W1  | place    | house         | poly-area:5.0 |
           | R1  | boundary | national_park | poly-area:5.0 |
+          | R2  | highway  | residential   | poly-area:5.0 |
         When importing
         Then placex contains
           | object | rank_address |
           | R1     | 30 |
         When importing
         Then placex contains
           | object | rank_address |
           | R1     | 30 |
+          | R2     | 26 |
           | W1     | 30 |
           | W1     | 30 |
-        When marking for delete R1,W1
+        When marking for delete R1,R2,W1
         Then placex has no entry for W1
         Then placex has no entry for R1
         Then placex has no entry for W1
         Then placex has no entry for R1
+        Then placex has no entry for R2
 
     Scenario: type mutation
         Given the places
 
     Scenario: type mutation
         Given the places