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

Dummy geometry for scrub pattern compatibility #2748

Merged
merged 1 commit into from
Oct 14, 2017

Conversation

sommerluk
Copy link
Collaborator

@sommerluk sommerluk commented Aug 14, 2017

The scrub pattern crosses the border horizontally, but not vertically. This PR passes the existing scrub pattern through the newest version of the sanitizer of jsdotpattern, so it gets a dummy geometry added (just to make sure that we work around Mapnik limitations)…

screenshot 2

@sommerluk
Copy link
Collaborator Author

Wrong screenshot, sorry. Substituted with the good one.

@kocio-pl
Copy link
Collaborator

I believe we should go with 256 px for all the patterns now (instead of 512 px).

@sommerluk
Copy link
Collaborator Author

Re-generated for 256 px.

Before:
01 before

After:
02 after

Copy link
Collaborator

@kocio-pl kocio-pl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has a bit more space but I don't feel this is a problem.

@matthijsmelissen
Copy link
Collaborator

Looks good to me. @imagico are there technical reasons why we should hold this off?

@kocio-pl kocio-pl mentioned this pull request Aug 23, 2017
Copy link
Collaborator

@imagico imagico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what i can add here.

@kocio-pl
Copy link
Collaborator

What do you suggest to do with it? Basic options would be to:

  1. Leave the current SVG pattern as it is.
  2. Revert to PNG version.
  3. Merge this SVG version
    a) as it is
    b) tune it more (how?)

Probably the same decision list applies to #2760 and other SVG patterns as well.

@sommerluk
Copy link
Collaborator Author

sommerluk commented Aug 23, 2017 via email

@imagico
Copy link
Collaborator

imagico commented Aug 23, 2017

I would normally suggest to discuss and decide on the matter of relaxed random patterns and regular patterns in general before making changes along these lines - but given the experience with discussing general design principles and guidelines in #2462 i am not sure if this is possible. In any case someone should make a conscious decision about this and i am not sure if @sommerluk did.

And yes, until #2750 is solved i would suggest to stick to PNG patterns for anything with transparency or partial pixel coverage.

@sommerluk
Copy link
Collaborator Author

Well, as I said, scrub.md had documented this as snub pattern yet before this PR, so this was not a conscious decision.

If desired, I could try to create another pattern that is randomized.

@imagico
Copy link
Collaborator

imagico commented Aug 23, 2017

I have reconstructed more or less the original command sequence based on the description by @meased (see #2395):

http://www.imagico.de/map/jsdotpattern.php#x,512,jdp97762;g5,45,64,64;rx,250,2,64,64;rx,250,2,64,64;rx,250,2,64,64;rd,1,0,0,scrub2,1,5,12,0,jdp3379,8ece8f,b5e3b5;

This cannot be directly translated to 256 pixel size because the relaxation dynamics are different then. You can still generate a relaxed random pattern at this size and density but it would not be very good - see also #937 (comment).

@kocio-pl
Copy link
Collaborator

I would normally suggest to discuss and decide on the matter of relaxed random patterns and regular patterns in general before making changes along these lines - but given the experience with discussing general design principles and guidelines in #2462 i am not sure if this is possible.

I'm more optimistic with that, because the scope would be much smaller.

@kocio-pl
Copy link
Collaborator

@sommerluk The problem with patterns looks quite complex (involving subtle Mapnik bugs and metatile issues), so the question is what do you plan to do with this code? For me the pattern is quite irregular (as needed for natural features) and works with 256px. Converting it to PNG would be safer, but I'm not sure if such precautions are really needed in this case.

@sommerluk
Copy link
Collaborator Author

I would propose doing things in this order:

  1. Decide if all patterns should 256 px maximum
  2. If it should be 256 px, I could try something based on the reconstructed pattern instructions to see it it works, otherwise I could take the reconstructed pattern instructions as is. (If desired I could also take the current pattern, but as it’s not randomized, not sure…?)
  3. Convert the pattern to PNG to avoid rendering problems
  4. Documentation: Update scrub.md so that it documents the original pattern generating instructions. Have also the origininal SVG file, from which the PNG was rendered, available.
  5. Merge 😉

I could take a look at steps 2, 3 and 4, but I would like to wait until there is a decision about step 1.

@kocio-pl
Copy link
Collaborator

It doesn't look like we have any pattern related decisions coming any time soon and I don't have an opinion what to do with them, so I will leave it to you.

@sommerluk
Copy link
Collaborator Author

screenshot 1

The easiest solution for now: The pattern as reconstructed by @imagico just converted to PNG, with documentation. (And also a minor documentation fix for leaftype.) There are currently more patterns > 256 px anyway. If later we decide to switch to patterns ≤ 256 px, we have documentation available about the pattern generation for scrub.

@kocio-pl
Copy link
Collaborator

I think that leaftype documentation fix doesn't belong here, so please open another PR for it.

@sommerluk
Copy link
Collaborator Author

Now without documentation fix.

@kocio-pl
Copy link
Collaborator

If you feel it's OK, you can merge it yourself now in my opinion, since enough time has passed and nobody else is ready to do that (including me).

@sommerluk
Copy link
Collaborator Author

There are three merge options (Create…, Squash…, Rebase…). Which one should I use preferred?

@kocio-pl
Copy link
Collaborator

You don't have to even use pull down menu, just click "Merge pull request" button in standard cases.

@sommerluk sommerluk merged commit c653560 into gravitystorm:master Oct 14, 2017
@sommerluk sommerluk deleted the scrub01 branch October 25, 2017 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants