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

Small fixes to golf features #4467

Merged
merged 2 commits into from
Sep 23, 2021
Merged

Conversation

pitdicker
Copy link
Contributor

@pitdicker pitdicker commented Sep 13, 2021

Two minor fixes after the merge of #4381. They are mostly to keep my own setup working, but I hope it makes sense for others.

  • Define a golf-color for the golf holes, lines and text instead of reusing address-color.
  • Don't use comp-op: soft-light with the golf_rough.
  • Not fixed: the pattern is a cropped 40x40px SVG, that doesn't repeat properly. I would like to change that in Vector patterns #4463.

About comp-op
This is a feature supported by Mapnik, but not really by its SVG export. #3653 hit that issue. What happens is that the exported SVG either contains a rasterized image, or uses non-standard extensions (when exporting with the non-existing SVG 1.2). At some point proposals for SVG 1.2 including comp-op floated around and were implemented in Inkscape, librsvg and Mapnik, but those proposals were later dropped.

The result in most image viewers (those that are not based on librsvg) and in all browsers:
golf_rough_blend
5x:
golf_rough_blend_5x

The only current use of comp-op before #4381 was for admin boundaries, and it is a lot less noticeable when those don't look perfectly as intended.

I believe using comp-op in OSM-carto is desirable, and it would be nice to get workarounds at some point. SVG supports masks and filters, so a lot should be possible. But can the use of comp-op and the need for workarounds (or dropping support for exporting vector images) be delayed until there is a feature that is really worth it, such as #3854?

For now I would just like to use the simple solution: adjust the color of the SVG pattern for golf_rough, to use the color comp-op: soft-light would have resulted in:
golf_rough

@jgruca Are these changes acceptable?

@jgruca
Copy link
Contributor

jgruca commented Sep 13, 2021

No objections from me. Would it be preferable to set the color for the SVG in the MSS, though, per the current map icon guidelines?

@pitdicker
Copy link
Contributor Author

👍 If only we could set the color... Mapnik doesn't support such a setting for patterns (polygon-pattern reference).

@imagico
Copy link
Collaborator

imagico commented Sep 13, 2021

comp-op should not be used in patterns - if i had seen that in #4381 i would have requested to change that. Just design the pattern to directly generate the desired results on the background it is to be used on (or with the background included in the pattern). That is simple enough to do, jsdotpattern allows to preview the pattern in a chosen color.

But in general we will likely continue to use comp-op elsewhere - currently in particular for admin boundaries, potentially also for #3854 and in #4128.

@pnorman pnorman self-requested a review September 16, 2021 03:52
@pnorman pnorman mentioned this pull request Sep 16, 2021
@jeisenbe
Copy link
Collaborator

@pitdicker would you be able to address this?

"design the pattern to directly generate the desired results on the background it is to be used on (or with the background included in the pattern)"

@jgruca
Copy link
Contributor

jgruca commented Sep 19, 2021

I believe this was addressed by setting the pattern color directly in the SVG file.

@pitdicker
Copy link
Contributor Author

@jeisenbe As @jgruca says. To say a bit more:

Before making this PR I played a few hours with jsdotpattern, trying to get a similar looking pattern that would fit in a small tile such as 64x64. Just an experiment, and I got nowhere :-).

To keep the changes minimal, I made this PR with just the color adjusted in the already existing SVG, based on jsdotpattern. The end result is no different from setting the color in jsdotpattern and regenerating the SVG, except that I now didn't need to figure out a similar looking command sequence.

In #4463 (comment) I added a 128x128 version of the golf_rough pattern, based on the jsdotpattern sequence of the beach pattern. But the intention of this PR was to just be a minimal quick fix.

@pnorman pnorman merged commit 1b02d24 into gravitystorm:master Sep 23, 2021
@pitdicker pitdicker deleted the golf-features branch September 23, 2021 06:38
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

Successfully merging this pull request may close these issues.

5 participants