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

Switch sand and wetland patterns to SVG #2727

Merged
merged 1 commit into from
Aug 7, 2017
Merged
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
4 changes: 2 additions & 2 deletions landcover.mss
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@

#landcover-area-symbols {
[int_wetland != null][zoom >= 10] {
polygon-pattern-file: url('symbols/wetland.png');
polygon-pattern-file: url('symbols/wetland.svg');
polygon-pattern-alignment: global;
}
[natural = 'reef'][zoom >= 10] {
Expand Down Expand Up @@ -651,7 +651,7 @@
[natural = 'beach'],
[natural = 'shoal'] {
[surface = 'sand'] {
polygon-pattern-file: url('symbols/beach.png');
polygon-pattern-file: url('symbols/beach.svg');
polygon-pattern-alignment: global;
}
[surface = 'gravel'],
Expand Down
Binary file removed symbols/beach.png
Binary file not shown.
31 changes: 31 additions & 0 deletions symbols/beach.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 6 additions & 8 deletions symbols/generating_patterns/beach.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Pattern file for beach is generated in two steps.

The beach and reef patterns are rasterized and colored versions of the provided SVGs
In the first step visit [jsdotpattern (command sequence is recorded)](http://www.imagico.de/map/jsdotpattern.php#x,128,jdp59980;g,2.25,16,16;rx,250,2,8,8;rx,250,2,8,8;s,jdp58799;s,jdp49103;rx,250,2,8,8;rd,0,0,1,scree,0.1,5,10,0,jdp31724,dbb677,fff1ba;)

```
convert -depth 8 beach.svg beach_raw.png
convert -depth 8 reef.svg reef_raw.png
Use "get pattern SVG data" (it is expected that background will be transparent, background colour in jsdotpattern is only for display).

convert -depth 8 -size 128x128 xc:"#685d45" \( beach_raw.png -negate \) -set colorspace RGB -alpha Off -compose CopyOpacity -composite -set colorspace sRGB +gamma - beach.png
convert -depth 8 -size 256x256 xc:"#969696" \( reef_raw.png -negate \) -set colorspace RGB -alpha Off -compose CopyOpacity -composite -set colorspace sRGB +gamma - beach_coarse.png
convert -depth 8 -size 256x256 xc:"#549ccd" \( reef_raw.png -negate \) -set colorspace RGB -alpha Off -compose CopyOpacity -composite -set colorspace sRGB +gamma - reef.png
```
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 beach.svg
9 changes: 0 additions & 9 deletions symbols/generating_patterns/beach.svg

This file was deleted.

9 changes: 9 additions & 0 deletions symbols/generating_patterns/reef.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

The reef patterns are rasterized and colored versions of the provided SVG

```
convert -depth 8 reef.svg reef_raw.png

convert -depth 8 -size 256x256 xc:"#969696" \( reef_raw.png -negate \) -set colorspace RGB -alpha Off -compose CopyOpacity -composite -set colorspace sRGB +gamma - beach_coarse.png
convert -depth 8 -size 256x256 xc:"#549ccd" \( reef_raw.png -negate \) -set colorspace RGB -alpha Off -compose CopyOpacity -composite -set colorspace sRGB +gamma - reef.png
```
Binary file removed symbols/mud.png
Binary file not shown.
Binary file removed symbols/wetland.png
Binary file not shown.
6 changes: 6 additions & 0 deletions symbols/wetland.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.