mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
more invalidations when boundary changes rank
When a boundary or place changes its address rank, all places where it participates as address need to be potentially reindexed. Also use the computed rank when testing place nodes against boundaries. Boundaries are computed earlier. Fixes #2794.
This commit is contained in:
@@ -916,7 +916,8 @@ BEGIN
|
||||
LATERAL compute_place_rank(country_code, 'A', class, type,
|
||||
admin_level, False, null) prank
|
||||
WHERE osm_type = 'R'
|
||||
and prank.address_rank = NEW.rank_address
|
||||
and ((class = 'place' and prank.address_rank = NEW.rank_address)
|
||||
or (class = 'boundary' and rank_address = NEW.rank_address))
|
||||
and geometry && NEW.centroid and _ST_Covers(geometry, NEW.centroid)
|
||||
LIMIT 1
|
||||
LOOP
|
||||
@@ -1101,6 +1102,15 @@ BEGIN
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
{% if not disable_diff_updates %}
|
||||
IF OLD.rank_address != NEW.rank_address THEN
|
||||
-- After a rank shift all addresses containing us must be updated.
|
||||
UPDATE placex p SET indexed_status = 2 FROM place_addressline pa
|
||||
WHERE pa.address_place_id = NEW.place_id and p.place_id = pa.place_id
|
||||
and p.indexed_status = 0 and p.rank_address between 4 and 25;
|
||||
END IF;
|
||||
{% endif %}
|
||||
|
||||
IF NEW.admin_level = 2
|
||||
AND NEW.class = 'boundary' AND NEW.type = 'administrative'
|
||||
AND NEW.country_code IS NOT NULL AND NEW.osm_type = 'R'
|
||||
|
||||
Reference in New Issue
Block a user