mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 19:07:58 +00:00
fix copying of extratags from linked places
Didn't work correctly when the extratags of the parent relation was null.
This commit is contained in:
@@ -1600,17 +1600,13 @@ BEGIN
|
||||
END IF;
|
||||
|
||||
-- merge in extra tags
|
||||
IF NOT linkedPlacex.extratags IS NULL THEN
|
||||
NEW.extratags := linkedPlacex.extratags || NEW.extratags;
|
||||
END IF;
|
||||
|
||||
IF NOT NEW.extratags ? linkedPlacex.class THEN
|
||||
NEW.extratags := NEW.extratags || hstore(linkedPlacex.class, linkedPlacex.type);
|
||||
END IF;
|
||||
NEW.extratags := hstore(linkedPlacex.class, linkedPlacex.type) || coalesce(linkedPlacex.extratags, ''::hstore) || coalesce(NEW.extratags, ''::hstore);
|
||||
|
||||
-- mark the linked place (excludes from search results)
|
||||
UPDATE placex set linked_place_id = NEW.place_id where place_id = linkedPlacex.place_id;
|
||||
|
||||
-- keep a note of the node id in case we need it for wikipedia in a bit
|
||||
linked_node_id := linkedPlacex.osm_id;
|
||||
END LOOP;
|
||||
|
||||
END LOOP;
|
||||
@@ -1639,13 +1635,7 @@ BEGIN
|
||||
END IF;
|
||||
|
||||
-- merge in extra tags
|
||||
IF NOT linkedPlacex.extratags IS NULL THEN
|
||||
NEW.extratags := linkedPlacex.extratags || NEW.extratags;
|
||||
END IF;
|
||||
|
||||
IF NOT NEW.extratags ? linkedPlacex.class THEN
|
||||
NEW.extratags := NEW.extratags || hstore(linkedPlacex.class, linkedPlacex.type);
|
||||
END IF;
|
||||
NEW.extratags := hstore(linkedPlacex.class, linkedPlacex.type) || coalesce(linkedPlacex.extratags, ''::hstore) || coalesce(NEW.extratags, ''::hstore);
|
||||
|
||||
-- mark the linked place (excludes from search results)
|
||||
UPDATE placex set linked_place_id = NEW.place_id where place_id = linkedPlacex.place_id;
|
||||
@@ -1687,11 +1677,7 @@ BEGIN
|
||||
name_vector := make_keywords(NEW.name);
|
||||
|
||||
-- merge in extra tags
|
||||
NEW.extratags := linkedPlacex.extratags || NEW.extratags;
|
||||
|
||||
IF NOT NEW.extratags ? linkedPlacex.class THEN
|
||||
NEW.extratags := NEW.extratags || hstore(linkedPlacex.class, linkedPlacex.type);
|
||||
END IF;
|
||||
NEW.extratags := hstore(linkedPlacex.class, linkedPlacex.type) || coalesce(linkedPlacex.extratags, ''::hstore) || coalesce(NEW.extratags, ''::hstore);
|
||||
|
||||
-- mark the linked place (excludes from search results)
|
||||
UPDATE placex set linked_place_id = NEW.place_id where place_id = linkedPlacex.place_id;
|
||||
|
||||
Reference in New Issue
Block a user