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

Mapnik-compatible SVGs #3

Closed
pnorman opened this issue Jan 21, 2015 · 5 comments
Closed

Mapnik-compatible SVGs #3

pnorman opened this issue Jan 21, 2015 · 5 comments

Comments

@pnorman
Copy link

pnorman commented Jan 21, 2015

Mapnik cannot make use of SVGs with <use/> to my knowledge. This is annoying, but unlikely to change by 3.0 release. A mode to generate a SVG without would be useful.

This does not matter with currently released versions of Mapnik, which do not support SVGs for polygon-patterns at all, and the output of this tool is extremely unlikely to be used with a point symbolizer.

@imagico
Copy link
Owner

imagico commented Jan 21, 2015

Inlining every symbols will significantly blow up the file sizes so it will only be feasible for patterns with relatively few and simple symbols. But good to know this would be a requirement for use directly in Mapnik.

I am not too sure how useful svg patterns would actually be for direct use in rendering - much more useful would be if there was support for using grayscale pattern images to generate the actual pattern from the style.

@imagico
Copy link
Owner

imagico commented May 12, 2015

Inlining of symbols is now possible but not tested in mapnik yet.

@imagico
Copy link
Owner

imagico commented May 5, 2017

A script is now available that converts jsdotpattern SVGs into a Mapnik compatible form using inkscape. This is fairly ugly but there is no reasonable way to directly generate Mapnik compatible SVGs from within Snap (or other JS SVG libraries).

@imagico imagico closed this as completed May 5, 2017
@imagico
Copy link
Owner

imagico commented Jul 14, 2017

Apparently if the SVG content does not fully fill the bounding box Mapnik performs some kind of transform to the pattern that can break periodicity - see gravitystorm/openstreetmap-carto#2685

You can work around this by using symbol offsets so the pattern symbols cross all edges of the bounding box but it should be possible to work around this from svg_pattern.sh by adding an invisible dummy geometry.

@imagico
Copy link
Owner

imagico commented Aug 13, 2017

I hope this is now finally done by adding a dummy geometry in svg_pattern.sh.

@imagico imagico closed this as completed Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants