mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
Delete all records for a linked place so that they are no longer attached to new places
This commit is contained in:
@@ -1294,7 +1294,7 @@ BEGIN
|
|||||||
RETURN NULL;
|
RETURN NULL;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF NEW.indexed_status != 0 OR OLD.indexed_status = 0 OR NEW.linked_place_id is not null THEN
|
IF NEW.indexed_status != 0 OR OLD.indexed_status = 0 THEN
|
||||||
RETURN NEW;
|
RETURN NEW;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
@@ -1308,25 +1308,27 @@ BEGIN
|
|||||||
RETURN NEW;
|
RETURN NEW;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
-- TODO: this test is now redundant?
|
||||||
IF OLD.indexed_status != 0 THEN
|
IF OLD.indexed_status != 0 THEN
|
||||||
--DEBUG: RAISE WARNING 'placex_update_0 % %',NEW.osm_type,NEW.osm_id;
|
|
||||||
|
|
||||||
NEW.indexed_date = now();
|
NEW.indexed_date = now();
|
||||||
|
|
||||||
|
result := deleteSearchName(NEW.partition, NEW.place_id);
|
||||||
|
DELETE FROM place_addressline WHERE place_id = NEW.place_id;
|
||||||
|
DELETE FROM place_boundingbox where place_id = NEW.place_id;
|
||||||
|
result := deleteRoad(NEW.partition, NEW.place_id);
|
||||||
|
result := deleteLocationArea(NEW.partition, NEW.place_id, NEW.rank_search);
|
||||||
|
UPDATE placex set linked_place_id = null where linked_place_id = NEW.place_id;
|
||||||
|
|
||||||
|
IF NEW.linked_place_id is not null THEN
|
||||||
|
RETURN NEW;
|
||||||
|
END IF;
|
||||||
|
|
||||||
IF NEW.class = 'place' AND NEW.type = 'houses' THEN
|
IF NEW.class = 'place' AND NEW.type = 'houses' THEN
|
||||||
i := create_interpolation(NEW.osm_id, NEW.housenumber);
|
i := create_interpolation(NEW.osm_id, NEW.housenumber);
|
||||||
RETURN NEW;
|
RETURN NEW;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF OLD.indexed_status > 0 THEN
|
|
||||||
result := deleteSearchName(NEW.partition, NEW.place_id);
|
|
||||||
DELETE FROM place_addressline WHERE place_id = NEW.place_id;
|
|
||||||
DELETE FROM place_boundingbox where place_id = NEW.place_id;
|
|
||||||
result := deleteRoad(NEW.partition, NEW.place_id);
|
|
||||||
result := deleteLocationArea(NEW.partition, NEW.place_id, NEW.rank_search);
|
|
||||||
UPDATE placex set linked_place_id = null where linked_place_id = NEW.place_id;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
-- Speed up searches - just use the centroid of the feature
|
-- Speed up searches - just use the centroid of the feature
|
||||||
-- cheaper but less acurate
|
-- cheaper but less acurate
|
||||||
place_centroid := ST_PointOnSurface(NEW.geometry);
|
place_centroid := ST_PointOnSurface(NEW.geometry);
|
||||||
|
|||||||
Reference in New Issue
Block a user