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

Convert patterns to SVG #2045

Open
8 of 18 tasks
pnorman opened this issue Feb 16, 2016 · 13 comments
Open
8 of 18 tasks

Convert patterns to SVG #2045

pnorman opened this issue Feb 16, 2016 · 13 comments

Comments

@pnorman
Copy link
Collaborator

pnorman commented Feb 16, 2016

This will require Mapnik 3, but we want to move these PNGs to vectors for better high-resolution support.

Landuses:

Cemeteries:

Lines:

@pnorman pnorman added this to the 3.x - Needs upgrade to Mapnik milestone Feb 16, 2016
@kocio-pl
Copy link
Collaborator

We could start doing it now, as the software update on servers is ready, but that would break all the other systems still using Mapnik 2. We need a roadmap first - see #2198.

@kocio-pl
Copy link
Collaborator

kocio-pl commented Dec 4, 2016

I think of this ticket as meta-issue, because each pattern requires separate PR probably. I'm not sure how to count them, because some of them are combined, but let's start with this list:

@HolgerJeromin
Copy link
Contributor

If you add the checkbox list to the first post the "ready count" will be displayed on many places here.

@kocio-pl
Copy link
Collaborator

kocio-pl commented Dec 5, 2016

I can do it if Paul has noting against it, but first I wanted to know if I get this list right.

@pnorman pnorman removed this from the Upgrade Mapnik to 3.0 milestone Dec 5, 2016
@kocio-pl kocio-pl added this to the Bugs and improvements milestone Dec 5, 2016
@imagico
Copy link
Collaborator

imagico commented Dec 5, 2016

In my eyes the line patterns (cliff/embankment) are much more important to move the SVG since they will actually profit from this in terms of normal rendering results.

For the area patterns i would before all put

  • check if there are any serious performance implications of moving to SVG patterns, especially if the SVGs are fairly large

@pnorman
Copy link
Collaborator Author

pnorman commented Dec 5, 2016

check if there are any serious performance implications of moving to SVG patterns, especially if the SVGs are fairly large

Mapnik converts SVGs to images as a one time operation for icons and caches the result. I expect it does the same for SVGs as patterns.

@kocio-pl
Copy link
Collaborator

kocio-pl commented Dec 5, 2016

BTW: do we have any other line patterns except those two (cliff and embankment)? We should add all of them to the checklist and check/strike them later.

@Ircama
Copy link
Contributor

Ircama commented Dec 5, 2016

As I'm developing the new PR for rendering aretes and ridges (sorry for the delay BTW, I have limited spare time), I'd like to know whether I can keep the already available PNG icons or I necessarily need to convert them to SVG, thanks.

@imagico
Copy link
Collaborator

imagico commented Dec 5, 2016

@kocio-pl - https://github.com/gravitystorm/openstreetmap-carto/search?utf8=%E2%9C%93&q=line-pattern-file

@Ircama - creating them as SVG would be highly advisable because it gives you better control and adjustability and leads to more consistent results. But it is not a big deal in my opinion - if you have a draft as PNG that works nicely it should not be too difficult to translate that concept into a vector design but if you end up re-designing your current drafts anyway it would make sense not to invest into pixel painting it.

@kocio-pl
Copy link
Collaborator

Related to #1165.

@imagico
Copy link
Collaborator

imagico commented May 5, 2017

I have looked into the problem with using jsdotpattern generated SVGs and it seems Mapnik is just extremely limited in the SVG functionality it understands. Not only <use> is unsupported, nested groups with transforms are apparently not correctly interpreted either.

I have added a script to the jsdotpattern repository (https://github.com/imagico/jsdotpattern/blob/master/svg_pattern.sh) that uses inkscape to sanitize jsdotpattern generated SVGs to be compatible with Mapnik by flattening + clipping the whole content and converting it to a single path.

Note inkscape can be fairly slow with that, the uncloning step on a complex non-inlined pattern can take several minutes.

The script also has a third optional parameter that allows clipping the pattern to a strip in y-direction which will allow using it as a line pattern which might be useful for example in #110.

@Klaus-Tockloth
Copy link

Any progress here? Is mapnik still the limiting component?

@kocio-pl
Copy link
Collaborator

It has to be tested, some description of the problem is here: #2727 (comment) and here: #2750.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants