enforce presence of importance value in placex

This commit is contained in:
Sarah Hoffmann
2026-03-02 09:57:34 +01:00
parent d43e95f177
commit a16c698fb2
4 changed files with 11 additions and 7 deletions

View File

@@ -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 %}