mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-10 21:04:07 +00:00
enforce presence of importance value in placex
This commit is contained in:
@@ -731,6 +731,10 @@ BEGIN
|
||||
|
||||
END IF;
|
||||
|
||||
IF NEW.importance IS NULL THEN
|
||||
NEW.importance := 0.40001 - (NEW.rank_search::float / 75);
|
||||
END IF;
|
||||
|
||||
{% if debug %}RAISE WARNING 'placex_insert:END: % % % %',NEW.osm_type,NEW.osm_id,NEW.class,NEW.type;{% endif %}
|
||||
|
||||
{% if not disable_diff_updates %}
|
||||
@@ -1076,10 +1080,8 @@ BEGIN
|
||||
{% if debug %}RAISE WARNING 'Waterway processed';{% endif %}
|
||||
END IF;
|
||||
|
||||
NEW.importance := null;
|
||||
SELECT wikipedia, importance
|
||||
FROM compute_importance(NEW.extratags, NEW.country_code, NEW.rank_search, NEW.centroid)
|
||||
INTO NEW.wikipedia,NEW.importance;
|
||||
SELECT wikipedia, importance INTO NEW.wikipedia, NEW.importance
|
||||
FROM compute_importance(NEW.extratags, NEW.country_code, NEW.rank_search, NEW.centroid);
|
||||
|
||||
{% if debug %}RAISE WARNING 'Importance computed from wikipedia: %', NEW.importance;{% endif %}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ CREATE TABLE placex (
|
||||
place_id BIGINT NOT NULL,
|
||||
parent_place_id BIGINT,
|
||||
linked_place_id BIGINT,
|
||||
importance FLOAT,
|
||||
importance FLOAT NOT NULL,
|
||||
indexed_date TIMESTAMP,
|
||||
geometry_sector INTEGER NOT NULL,
|
||||
rank_address SMALLINT NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user