From b9f3b0f9c15dbb0bda7f92d5797d1fa351b6ef94 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Sat, 4 Mar 2023 19:27:26 +0100 Subject: [PATCH] Optimize Z9 rendering Z9 was quite anomaly in terms of rendering time. It was taking much longer than Z8 and Z10 during pre-computation. Dominant layer was landuse_gen0. It was using subpixel rendering for landuse, which is useful at very low zoom but seems to be safely discardable at Z9. See as well https://github.com/gravitystorm/openstreetmap-carto/pull/2874 and https://github.com/gravitystorm/openstreetmap-carto/pull/3458#issuecomment-430873795. See https://github.com/cyclosm/cyclosm-cartocss-style/issues/644. --- base.mss | 4 ++-- project.mml | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/base.mss b/base.mss index 123469f..36cc883 100644 --- a/base.mss +++ b/base.mss @@ -17,8 +17,8 @@ polygon-gamma: 0.75; } -#landuse_gen0[zoom>1][zoom<=9], -#landuse_gen1[zoom>9][zoom<=12], +#landuse_gen0[zoom>1][zoom<=8], +#landuse_gen1[zoom>8][zoom<=12], #landuse[zoom>=13] { [type='amenity_grave_yard'], [type='landuse_cemetery'] { diff --git a/project.mml b/project.mml index 0db4306..3d10fb1 100644 --- a/project.mml +++ b/project.mml @@ -84,7 +84,7 @@ Layer: CASE WHEN "natural" IS NOT NULL THEN ('natural_' || "natural") ELSE NULL END, CASE WHEN leisure IS NOT NULL THEN ('leisure_' || leisure) ELSE NULL END, CASE WHEN amenity IS NOT NULL THEN ('amenity_' || amenity) ELSE NULL END, - CASE WHEN highway IN ('pedestrian') THEN ('highway_' || highway) ELSE NULL END + CASE WHEN highway IS NOT NULL THEN ('highway_' || highway) ELSE NULL END ) AS type, sport FROM planet_osm_polygon @@ -102,7 +102,7 @@ Layer: geometry: polygon properties: minzoom: 2 - maxzoom: 9 + maxzoom: 8 - id: landuse_gen1 <<: *extents Datasource: @@ -129,12 +129,13 @@ Layer: OR highway IN ('pedestrian') ) AND way_area > 1*!pixel_width!::real*!pixel_height!::real + AND way && !bbox! ORDER BY way_area DESC ) AS data geometry: polygon properties: cache-features: true - minzoom: 10 + minzoom: 9 maxzoom: 12 - id: landuse <<: *extents @@ -182,6 +183,7 @@ Layer: ("natural" = 'wood' OR landuse = 'forest') AND building IS NULL AND way_area > 1*!pixel_width!::real*!pixel_height!::real + AND way && !bbox! ORDER BY way_area DESC ) AS data geometry: polygon @@ -336,6 +338,7 @@ Layer: OR landuse in ('basin', 'reservoir') ) AND way_area > 0.1*!pixel_width!::real*!pixel_height!::real + AND way && !bbox! AND (tunnel IS NULL OR tunnel NOT IN ('yes', 'culvert')) ) AS data geometry: polygon @@ -363,6 +366,7 @@ Layer: OR landuse in ('basin', 'reservoir') ) AND way_area > 1*!pixel_width!::real*!pixel_height!::real + AND way && !bbox! AND (tunnel IS NULL OR tunnel NOT IN ('yes', 'culvert')) ) AS data geometry: polygon @@ -924,6 +928,7 @@ Layer: OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99'))) AND building IS NULL AND way_area > 1*!pixel_width!::real*!pixel_height!::real + AND way && !bbox! ) AS protected_areas properties: cache-features: true @@ -1920,6 +1925,7 @@ Layer: (landuse = 'military' OR military = 'danger_area') AND building IS NULL AND way_area > 1*!pixel_width!::real*!pixel_height!::real + AND way && !bbox! ORDER BY way_area DESC ) AS data geometry: polygon