From 2e04f831664eb303e98354bb9dba0ed2511dc998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20La=C5=BEa?= Date: Wed, 5 Jan 2022 07:28:34 +0100 Subject: [PATCH] Fix paths and tracks in transportation layer z12 and z13 (#1334) This PR fixes a bug that causes that `track` lines disappear at z13. This bug was introduced in https://github.com/openmaptiles/openmaptiles/pull/1190, which adds rendering of paths and tracks at z12 and z13. Before this PR: z12: lines with `route_rank = 1` are added (no matter what `highway`). z13: lines with `route_rank BETWEEN 1 AND 2` and `highway = 'path'` are added. -> tracks with `route_rank=1` are added at z12 but not at z13. After this PR z12: lines with `route_rank = 1` and `highway IN ('path', 'track')` are added. z13: lines with `route_rank BETWEEN 1 AND 2` and `highway IN ('path', 'track')` are added . -> only tracks and paths are added at z12 and z13 (which was IMHO the goal of https://github.com/openmaptiles/openmaptiles/pull/1190) * Add only the most important paths and tracks (route_rank=1) to z12 and more important ones (route_rank between 1-2 or sac_scale or has name) to z13. --- layers/transportation/transportation.sql | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/layers/transportation/transportation.sql b/layers/transportation/transportation.sql index fd7a22f..349fe1c 100644 --- a/layers/transportation/transportation.sql +++ b/layers/transportation/transportation.sql @@ -376,15 +376,14 @@ FROM ( AND CASE WHEN zoom_level = 12 THEN CASE WHEN transportation_filter_z12(hl.highway, hl.construction) THEN TRUE - WHEN n.route_rank = 1 THEN TRUE + WHEN hl.highway IN ('track', 'path') THEN n.route_rank = 1 END WHEN zoom_level = 13 THEN CASE WHEN man_made='pier' THEN NOT ST_IsClosed(hl.geometry) - WHEN hl.highway = 'path' THEN ( - hl.name <> '' - OR n.route_rank BETWEEN 1 AND 2 - OR hl.sac_scale <> '' - ) + WHEN hl.highway IN ('track', 'path') THEN (hl.name <> '' + OR n.route_rank BETWEEN 1 AND 2 + OR hl.sac_scale <> '' + ) ELSE transportation_filter_z13(hl.highway, public_transport, hl.construction, service) END WHEN zoom_level >= 14 THEN