From 8f9770e54692d84695b9b1daf6b90d3e92d2e226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Rodrigo?= Date: Wed, 22 Apr 2020 09:03:10 +0200 Subject: [PATCH] Reorder POI data update and trigger creation to avoid refresh of materialized view on initial import (#780) Reorder POI data update and trigger creation to avoid refresh of materialized view after update done by initial import. I checked the other updates and there are OK. --- layers/poi/poi.yaml | 4 ++-- layers/poi/poi_stop_agg.sql | 3 --- layers/poi/update_poi_point.sql | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/layers/poi/poi.yaml b/layers/poi/poi.yaml index d678bd65..ed49fea7 100644 --- a/layers/poi/poi.yaml +++ b/layers/poi/poi.yaml @@ -146,10 +146,10 @@ layer: query: (SELECT osm_id, geometry, name, name_en, name_de, {name_languages}, class, subclass, agg_stop, layer, level, indoor, rank FROM layer_poi(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t schema: - ./public_transport_stop_type.sql - - ./update_poi_polygon.sql - - ./update_poi_point.sql - ./class.sql - ./poi_stop_agg.sql + - ./update_poi_polygon.sql + - ./update_poi_point.sql - ./layer.sql datasources: - type: imposm3 diff --git a/layers/poi/poi_stop_agg.sql b/layers/poi/poi_stop_agg.sql index 788bcda6..4e4f40ac 100644 --- a/layers/poi/poi_stop_agg.sql +++ b/layers/poi/poi_stop_agg.sql @@ -33,6 +33,3 @@ CREATE MATERIALIZED VIEW osm_poi_stop_rank AS ( subclass IN ('bus_stop', 'bus_station', 'tram_stop', 'subway') ORDER BY p.uic_ref, rk ) /* DELAY_MATERIALIZED_VIEW_CREATION */; - -ALTER TABLE osm_poi_point ADD COLUMN IF NOT EXISTS agg_stop INTEGER DEFAULT NULL; -SELECT update_osm_poi_point_agg(); diff --git a/layers/poi/update_poi_point.sql b/layers/poi/update_poi_point.sql index dddec1d8..bd6aeb41 100644 --- a/layers/poi/update_poi_point.sql +++ b/layers/poi/update_poi_point.sql @@ -43,6 +43,9 @@ BEGIN END; $$ LANGUAGE plpgsql; +ALTER TABLE osm_poi_point ADD COLUMN IF NOT EXISTS agg_stop INTEGER DEFAULT NULL; +SELECT update_osm_poi_point_agg(); + -- Handle updates CREATE SCHEMA IF NOT EXISTS poi_point;