Skip to content

Commit

Permalink
Add rule to render landuse flowerbed (#4889)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
MeonStudios and Mattijs Leon authored Nov 2, 2023
1 parent 4abe70d commit fe6fd98
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 1 deletion.
2 changes: 1 addition & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
20 changes: 20 additions & 0 deletions style/landcover.mss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
26 changes: 26 additions & 0 deletions symbols/flowerbed_high_zoom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions symbols/flowerbed_mid_zoom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions symbols/generating_patterns/flowerbed.md
Original file line number Diff line number Diff line change
@@ -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`

0 comments on commit fe6fd98

Please sign in to comment.