mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
force delete from place if there is no corresponding object in placex
This might happen for nameless landuse/natural objects that are added to place during initial import but then dropped when being copied to placex. If they later receive a name, thus becoming valid, then place_insert should delete the orphan object in place and reinsert it. If they are large enough, the place_delete trigger prevents them from being removed. The additional update fools the delete trigger.
This commit is contained in:
@@ -2097,6 +2097,9 @@ BEGIN
|
||||
IF existingplacex.osm_type IS NULL THEN
|
||||
|
||||
IF existing.osm_type IS NOT NULL THEN
|
||||
-- pathological case caused by the triggerless copy into place during initial import
|
||||
-- force delete even for large areas, it will be reinserted later
|
||||
UPDATE place set geometry = ST_SetSRID(ST_Point(0,0), 4326) where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class and type = NEW.type;
|
||||
DELETE from place where osm_type = NEW.osm_type and osm_id = NEW.osm_id and class = NEW.class and type = NEW.type;
|
||||
END IF;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user