From 2d0b7159d03037096429e3724a4487408bcaa260 Mon Sep 17 00:00:00 2001 From: zstadler Date: Wed, 20 Apr 2022 06:50:37 +0300 Subject: [PATCH] Update aerodrome_label class in DIFF_MODE=true (#1371) The class field was not updated if needed during the import of changes in DIFF_MODE=true. --- .../update_aerodrome_label_point.sql | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/layers/aerodrome_label/update_aerodrome_label_point.sql b/layers/aerodrome_label/update_aerodrome_label_point.sql index 4a8c7ff7..72eb175a 100644 --- a/layers/aerodrome_label/update_aerodrome_label_point.sql +++ b/layers/aerodrome_label/update_aerodrome_label_point.sql @@ -8,12 +8,6 @@ CREATE INDEX IF NOT EXISTS osm_aerodrome_label_point_type_partial_idx WHERE aerodrome_type = 'international' AND iata <> ''; -UPDATE osm_aerodrome_label_point SET aerodrome_type=( - CASE - %%FIELD_MAPPING: class %% - ELSE 'other' END -); - CREATE SCHEMA IF NOT EXISTS aerodrome_label; CREATE TABLE IF NOT EXISTS aerodrome_label.osm_ids @@ -34,6 +28,17 @@ $$ WHERE (full_update OR osm_id IN (SELECT osm_id FROM aerodrome_label.osm_ids)) AND COALESCE(tags->'name:latin', tags->'name:nonlatin', tags->'name_int') IS NULL AND tags != update_tags(tags, geometry); + + UPDATE osm_aerodrome_label_point + SET aerodrome_type= + CASE + %%FIELD_MAPPING: class %% + ELSE 'other' END + WHERE (full_update OR osm_id IN (SELECT osm_id FROM aerodrome_label.osm_ids)) + AND aerodrome_type != + CASE + %%FIELD_MAPPING: class %% + ELSE 'other' END; $$ LANGUAGE SQL; SELECT update_aerodrome_label_point(true);