From f98ade427e2e9cc4ba4b4f1d06b17157c669a338 Mon Sep 17 00:00:00 2001 From: stirringhalo Date: Wed, 28 Dec 2016 18:16:49 -0500 Subject: [PATCH 1/2] Drop tables to force redo on update Reorder --- layers/transportation_name/layer.sql | 1 - layers/transportation_name/merge_highways.sql | 5 +++++ layers/water_name/water_lakeline.sql | 2 ++ layers/water_name/water_point.sql | 2 ++ layers/waterway/merge_waterway.sql | 5 +++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/layers/transportation_name/layer.sql b/layers/transportation_name/layer.sql index 2d68bfff..7d11ce21 100644 --- a/layers/transportation_name/layer.sql +++ b/layers/transportation_name/layer.sql @@ -1,4 +1,3 @@ - -- etldoc: layer_transportation_name[shape=record fillcolor=lightpink, style="rounded,filled", -- etldoc: label="layer_transportation_name | z8 | z9 | z10 | z11 | z12| z13| z14+" ] ; diff --git a/layers/transportation_name/merge_highways.sql b/layers/transportation_name/merge_highways.sql index 6a58c993..e0ca2488 100644 --- a/layers/transportation_name/merge_highways.sql +++ b/layers/transportation_name/merge_highways.sql @@ -1,3 +1,8 @@ +DROP TABLE IF EXISTS osm_transportation_name_linestring; +DROP TABLE IF EXISTS osm_transportation_name_linestring_gen1; +DROP TABLE IF EXISTS osm_transportation_name_linestring_gen2; +DROP TABLE IF EXISTS osm_transportation_name_linestring_gen3; + -- Instead of using relations to find out the road names we -- stitch together the touching ways with the same name -- to allow for nice label rendering diff --git a/layers/water_name/water_lakeline.sql b/layers/water_name/water_lakeline.sql index 20381efb..2593a270 100644 --- a/layers/water_name/water_lakeline.sql +++ b/layers/water_name/water_lakeline.sql @@ -1,3 +1,5 @@ +DROP TABLE IF EXISTS osm_water_lakeline; + -- etldoc: osm_water_polygon -> osm_water_lakeline -- etldoc: lake_centerline -> osm_water_lakeline CREATE TABLE IF NOT EXISTS osm_water_lakeline AS ( diff --git a/layers/water_name/water_point.sql b/layers/water_name/water_point.sql index 5f9658a4..54b5b45f 100644 --- a/layers/water_name/water_point.sql +++ b/layers/water_name/water_point.sql @@ -1,3 +1,5 @@ +DROP TABLE IF EXISTS osm_water_point; + -- etldoc: osm_water_polygon -> osm_water_point -- etldoc: lake_centerline -> osm_water_point CREATE TABLE IF NOT EXISTS osm_water_point AS ( diff --git a/layers/waterway/merge_waterway.sql b/layers/waterway/merge_waterway.sql index c58b21a5..6e2b8163 100644 --- a/layers/waterway/merge_waterway.sql +++ b/layers/waterway/merge_waterway.sql @@ -1,3 +1,8 @@ +DROP TABLE IF EXISTS osm_important_waterway_linestring; +DROP TABLE IF EXISTS osm_important_waterway_linestring_gen1; +DROP TABLE IF EXISTS osm_important_waterway_linestring_gen2; +DROP TABLE IF EXISTS osm_important_waterway_linestring_gen3; + -- We merge the waterways by name like the highways -- This helps to drop not important rivers (since they do not have a name) -- and also makes it possible to filter out too short rivers From 8b30e5ddc2945c8ccb69beb3deb0ae96fdb1cbf7 Mon Sep 17 00:00:00 2001 From: stirringhalo Date: Wed, 28 Dec 2016 18:19:54 -0500 Subject: [PATCH 2/2] Add cascade to drops --- layers/transportation_name/layer.sql | 1 + layers/transportation_name/merge_highways.sql | 9 +++++---- layers/water_name/water_lakeline.sql | 3 ++- layers/water_name/water_point.sql | 3 ++- layers/waterway/merge_waterway.sql | 9 +++++---- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/layers/transportation_name/layer.sql b/layers/transportation_name/layer.sql index 7d11ce21..2d68bfff 100644 --- a/layers/transportation_name/layer.sql +++ b/layers/transportation_name/layer.sql @@ -1,3 +1,4 @@ + -- etldoc: layer_transportation_name[shape=record fillcolor=lightpink, style="rounded,filled", -- etldoc: label="layer_transportation_name | z8 | z9 | z10 | z11 | z12| z13| z14+" ] ; diff --git a/layers/transportation_name/merge_highways.sql b/layers/transportation_name/merge_highways.sql index e0ca2488..c834c17e 100644 --- a/layers/transportation_name/merge_highways.sql +++ b/layers/transportation_name/merge_highways.sql @@ -1,7 +1,8 @@ -DROP TABLE IF EXISTS osm_transportation_name_linestring; -DROP TABLE IF EXISTS osm_transportation_name_linestring_gen1; -DROP TABLE IF EXISTS osm_transportation_name_linestring_gen2; -DROP TABLE IF EXISTS osm_transportation_name_linestring_gen3; + +DROP TABLE IF EXISTS osm_transportation_name_linestring CASCADE; +DROP TABLE IF EXISTS osm_transportation_name_linestring_gen1 CASCADE; +DROP TABLE IF EXISTS osm_transportation_name_linestring_gen2 CASCADE; +DROP TABLE IF EXISTS osm_transportation_name_linestring_gen3 CASCADE; -- Instead of using relations to find out the road names we -- stitch together the touching ways with the same name diff --git a/layers/water_name/water_lakeline.sql b/layers/water_name/water_lakeline.sql index 2593a270..16522e85 100644 --- a/layers/water_name/water_lakeline.sql +++ b/layers/water_name/water_lakeline.sql @@ -1,4 +1,5 @@ -DROP TABLE IF EXISTS osm_water_lakeline; + +DROP TABLE IF EXISTS osm_water_lakeline CASCADE; -- etldoc: osm_water_polygon -> osm_water_lakeline -- etldoc: lake_centerline -> osm_water_lakeline diff --git a/layers/water_name/water_point.sql b/layers/water_name/water_point.sql index 54b5b45f..498a6e8c 100644 --- a/layers/water_name/water_point.sql +++ b/layers/water_name/water_point.sql @@ -1,4 +1,5 @@ -DROP TABLE IF EXISTS osm_water_point; + +DROP TABLE IF EXISTS osm_water_point CASCADE; -- etldoc: osm_water_polygon -> osm_water_point -- etldoc: lake_centerline -> osm_water_point diff --git a/layers/waterway/merge_waterway.sql b/layers/waterway/merge_waterway.sql index 6e2b8163..604e0049 100644 --- a/layers/waterway/merge_waterway.sql +++ b/layers/waterway/merge_waterway.sql @@ -1,7 +1,8 @@ -DROP TABLE IF EXISTS osm_important_waterway_linestring; -DROP TABLE IF EXISTS osm_important_waterway_linestring_gen1; -DROP TABLE IF EXISTS osm_important_waterway_linestring_gen2; -DROP TABLE IF EXISTS osm_important_waterway_linestring_gen3; + +DROP TABLE IF EXISTS osm_important_waterway_linestring CASCADE; +DROP TABLE IF EXISTS osm_important_waterway_linestring_gen1 CASCADE; +DROP TABLE IF EXISTS osm_important_waterway_linestring_gen2 CASCADE; +DROP TABLE IF EXISTS osm_important_waterway_linestring_gen3 CASCADE; -- We merge the waterways by name like the highways -- This helps to drop not important rivers (since they do not have a name)