From c4d86d44a661146c273b97ac294db2381a570b2c Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 28 Nov 2022 13:19:29 -0500 Subject: [PATCH] Fix zoom ordering (#1444) This PR improves the behavior introduced in #1440, which inadvertently included all motorways at z4, which was unintended. Instead, this PR provides an appropriate progression from z4 to z5 with the highest national-importance highways being rendered at z4 (including where they degrade to trunk, as in Canada), and all motorways being added to the mix at z5. --- .../update_transportation_merge.sql | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/layers/transportation/update_transportation_merge.sql b/layers/transportation/update_transportation_merge.sql index 95e8574f..9f048a46 100644 --- a/layers/transportation/update_transportation_merge.sql +++ b/layers/transportation/update_transportation_merge.sql @@ -327,7 +327,14 @@ BEGIN FROM osm_transportation_merge_linestring_gen_z6 WHERE (update_id IS NULL OR id = update_id) AND - -- Current view: motorway/trunk + -- Current view: all motorways and trunks of national-importance + (highway = 'motorway' + OR construction = 'motorway' + -- Allow trunk roads that are part of a nation's most important route network to show at z4 + OR highway = 'trunk' AND + network <> '' AND + network IN ('ca-transcanada','us-interstate') + ) AND ST_Length(geometry) > 500; DELETE FROM osm_transportation_merge_linestring_gen_z4 @@ -349,13 +356,8 @@ BEGIN FROM osm_transportation_merge_linestring_gen_z5 WHERE (update_id IS NULL OR id = update_id) AND - (highway = 'motorway' - OR construction = 'motorway' - -- Allow trunk roads that are part of a nation's most important route network to show at z4 - OR highway = 'trunk' AND - network <> '' AND - network IN ('ca-transcanada','us-interstate') - ) AND + -- Current view: national-importance motorways and trunks + network IN ('ca-transcanada','us-interstate') AND ST_Length(geometry) > 1000; END; $$ LANGUAGE plpgsql;