Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render bare_rock pattern in landcover-area-symbols #3851

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions landcover.mss
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,11 @@

[feature = 'natural_bare_rock'][zoom >= 5] {
polygon-fill: @bare_ground;
polygon-pattern-file: url('symbols/rock_overlay.png');
[way_pixels >= 4] {
polygon-gamma: 0.75;
polygon-pattern-gamma: 0.75;
}
[way_pixels >= 64] {
polygon-gamma: 0.3;
polygon-pattern-gamma: 0.3;
}
}

Expand Down Expand Up @@ -720,6 +717,15 @@
}
}

[natural = 'bare_rock'][zoom >= 5] {
polygon-pattern-file: url('symbols/bare_rock5.png');
[way_pixels >= 4] {
polygon-pattern-gamma: 0.75;
}
[way_pixels >= 64] {
polygon-pattern-gamma: 0.3;
}
}
[natural = 'sand'][zoom >= 5] {
polygon-pattern-file: url('symbols/beach.png');
polygon-pattern-alignment: global;
Expand Down
2 changes: 1 addition & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ Layer:
tags->'leaf_type' AS leaf_type,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE ("natural" IN ('mud', 'wetland', 'wood', 'beach', 'shoal', 'reef', 'scrub', 'sand') OR landuse = 'forest')
WHERE ("natural" IN ('bare_rock', 'mud', 'wetland', 'wood', 'beach', 'shoal', 'reef', 'scrub', 'sand') OR landuse = 'forest')
AND building IS NULL
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY COALESCE(layer,0), way_area DESC
Expand Down
Binary file added symbols/bare_rock1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added symbols/bare_rock2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added symbols/bare_rock3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added symbols/bare_rock4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added symbols/bare_rock5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions symbols/generating_patterns/bare_rock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Pattern file for bare_rock is generated in 2 steps.

For the pattern visit [jsdotpattern (command sequence is recorded)](http://www.imagico.de/map/jsdotpattern.php#x,256,jdp18277;g,5,32,32;rx,25,2,32,32;rx,25,2,32,32;rx,25,2,32,32;rx,25,2,32,32;rx,25,2,32,32;rd,0,0,1,rock,0.1,24,24,0,jdp75459,8a99a5,eee5dc;)

Generate file - use "render" followed by using "get pattern SVG data" (it is expected that background will be transparent, background colour in jsdotpattern is only for display).

However, since SVG patterns is not properly handled by Mapnik at this time, the SVG file was converted to a PNG file with alpha channel, allotments.png
9 changes: 9 additions & 0 deletions symbols/generating_patterns/bare_rock1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions symbols/generating_patterns/bare_rock2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions symbols/generating_patterns/bare_rock3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions symbols/generating_patterns/bare_rock4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions symbols/generating_patterns/bare_rock5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.