From fe6fd98994fc8909a5f07ea1bae8c0e9492530ef Mon Sep 17 00:00:00 2001 From: Mattijs Leon Date: Thu, 2 Nov 2023 13:59:32 +0100 Subject: [PATCH] Add rule to render landuse flowerbed (#4889) * Add rule to render landuse flowerbed * Add non-pictorial rendering for lower zooms and keep pictorial rendering for high zoom levels. * Implement PR comments --------- Co-authored-by: Mattijs Leon --- project.mml | 2 +- style/landcover.mss | 20 ++++++++++++++++++ symbols/flowerbed_high_zoom.svg | 26 ++++++++++++++++++++++++ symbols/flowerbed_mid_zoom.svg | 26 ++++++++++++++++++++++++ symbols/generating_patterns/flowerbed.md | 15 ++++++++++++++ 5 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 symbols/flowerbed_high_zoom.svg create mode 100644 symbols/flowerbed_mid_zoom.svg create mode 100644 symbols/generating_patterns/flowerbed.md diff --git a/project.mml b/project.mml index c6d113463c..9b27791019 100644 --- a/project.mml +++ b/project.mml @@ -106,7 +106,7 @@ Layer: ('landuse_' || (CASE WHEN landuse IN ('quarry', 'vineyard', 'orchard', 'cemetery', 'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture', 'recreation_ground', 'village_green', 'retail', 'industrial', 'railway', 'commercial', - 'brownfield', 'landfill', 'salt_pond', 'construction', 'plant_nursery', 'religious') THEN landuse END)) AS landuse, + 'brownfield', 'landfill', 'salt_pond', 'construction', 'plant_nursery', 'religious', 'flowerbed') THEN landuse END)) AS landuse, ('shop_' || (CASE WHEN shop IN ('mall') AND (tags->'location' NOT IN ('underground') OR (tags->'location') IS NULL) THEN shop END)) AS shop, ('leisure_' || (CASE WHEN leisure IN ('swimming_pool', 'playground', 'park', 'garden', 'golf_course', 'miniature_golf', 'sports_centre', 'stadium', 'pitch', 'ice_rink', diff --git a/style/landcover.mss b/style/landcover.mss index 68c1ede00c..6e44dfee9a 100644 --- a/style/landcover.mss +++ b/style/landcover.mss @@ -168,6 +168,26 @@ } } + [feature = 'landuse_flowerbed'] { + [zoom >= 10] { + polygon-fill: @grass; + [way_pixels >= 4] { polygon-gamma: 0.75; } + [way_pixels >= 64] { polygon-gamma: 0.3; } + } + [zoom >= 15] { + polygon-pattern-file: url('symbols/flowerbed_mid_zoom.svg'); + polygon-pattern-alignment: global; + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + [zoom >= 17] { + polygon-pattern-file: url('symbols/flowerbed_high_zoom.svg'); + polygon-pattern-alignment: global; + [way_pixels >= 4] { polygon-pattern-gamma: 0.75; } + [way_pixels >= 64] { polygon-pattern-gamma: 0.3; } + } + } + [feature = 'landuse_plant_nursery'] { [zoom >= 10] { polygon-fill: @orchard; diff --git a/symbols/flowerbed_high_zoom.svg b/symbols/flowerbed_high_zoom.svg new file mode 100644 index 0000000000..305600a66e --- /dev/null +++ b/symbols/flowerbed_high_zoom.svg @@ -0,0 +1,26 @@ + + + + + + Created with Snap + diff --git a/symbols/flowerbed_mid_zoom.svg b/symbols/flowerbed_mid_zoom.svg new file mode 100644 index 0000000000..364694137d --- /dev/null +++ b/symbols/flowerbed_mid_zoom.svg @@ -0,0 +1,26 @@ + + + + + + Created with Snap + diff --git a/symbols/generating_patterns/flowerbed.md b/symbols/generating_patterns/flowerbed.md new file mode 100644 index 0000000000..ea6b31cb27 --- /dev/null +++ b/symbols/generating_patterns/flowerbed.md @@ -0,0 +1,15 @@ +The rendering for the flowerbed is split into two patterns: one for mid-zoom levels, and one for high zoom levels. + +### Flowerbed mid zoom +The pattern is generated using [jsdotpattern (command sequence is recorded)](https://imagico.de/map/jsdotpattern.php#x,128,jdp47459;gv,6,32,32;tr;ts;rd,0,0,0,dot,0.125,4,4,0,jdp75205,eef6c0,cdebb0;). + +Generated SVG image is sanitized for use with Mapnik by the script svg_pattern.sh from the jsdotpattern repository at http://github.com/imagico/jsdotpattern. + +The final file is `flowerbed_mid_zoom.svg` + +### Flowerbed high zoom +The pattern is generated using [jsdotpattern (command sequence is recorded)](https://imagico.de/map/jsdotpattern.php#x,128,jdp62563;gv,15,32,32;tr;rd,0,0,0,flower1,1,5,5,0,jdp49618,eef6c0,cdebb0;). + +Generated SVG image is sanitized for use with Mapnik by the script svg_pattern.sh from the jsdotpattern repository at http://github.com/imagico/jsdotpattern. + +The final file is `flowerbed_high_zoom.svg`