From aee838e29fdf90416b4b3f74dd40a6f050d73681 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 23 Aug 2021 05:49:19 -0400 Subject: [PATCH] Change zoom level for NE states/provinces (#1184) Fixes #1055 This PR moves Natural Earth zoom 7.7 boundary lines into zoom 4. > Hi, thank you for PR. In github-actions statistics there is a pretty high size increase in zooms 3, 2, 1, which are using data from zoom 4. Maybe keep your change to move `min_zoom <= 7.7` just for zoom 4, but for zoom 3 add a condition `min_zoom <= 7` (that subsequently the condition bubbles into zoom 2 and 1). What do you think? I agree that this makes sense, and thank you for pointing it out. It didn't occur to me that the zoom 1-3 tables were unbounded. I made the change to pull the `min_zoom` column into the zoom 4 generalized table and filter for `min_zoom< 7`. With this change, here is Algeria, zoom 3: ![image](https://user-images.githubusercontent.com/3254090/130368190-616891f4-4a53-4780-926b-561007291f33.png) Algeria, zoom 4: ![image](https://user-images.githubusercontent.com/3254090/130368194-d4e722bb-559b-4e2a-bb82-a5d1bd95985c.png) --- layers/boundary/boundary.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layers/boundary/boundary.sql b/layers/boundary/boundary.sql index a20d8cdc..0a380923 100644 --- a/layers/boundary/boundary.sql +++ b/layers/boundary/boundary.sql @@ -228,9 +228,10 @@ SELECT ST_Simplify(geometry, ZRes(6)) as geometry, FALSE AS disputed, NULL::text AS disputed_name, NULL::text AS claimed_by, - FALSE AS maritime + FALSE AS maritime, + min_zoom FROM ne_10m_admin_1_states_provinces_lines -WHERE min_zoom <= 7 +WHERE min_zoom <= 7.7 ) /* DELAY_MATERIALIZED_VIEW_CREATION */ ; CREATE INDEX IF NOT EXISTS ne_10m_admin_1_states_provinces_lines_gen_z4_idx ON ne_10m_admin_1_states_provinces_lines_gen_z4 USING gist (geometry); @@ -246,6 +247,7 @@ SELECT ST_Simplify(geometry, ZRes(5)) as geometry, claimed_by, maritime FROM ne_10m_admin_1_states_provinces_lines_gen_z4 +WHERE min_zoom <= 7 ) /* DELAY_MATERIALIZED_VIEW_CREATION */ ; CREATE INDEX IF NOT EXISTS ne_10m_admin_1_states_provinces_lines_gen_z3_idx ON ne_10m_admin_1_states_provinces_lines_gen_z3 USING gist (geometry);