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

[WIP] Preliminary styling for protected areas #66

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

kylebarron
Copy link
Contributor

Preliminary styling for protected areas. Would close #4. Styling is hard, so take this as a discussion point.

Adds labels for named protected_area and national_park Points.

In the current style.json, there's a park layer and a park_outline layer. Are both needed since there can be a specific color for the outline of a fill?
image

It's impossible to create a small diff because maputnik reformats the JSON automatically. In order for this PR's diff to be small, it would be best if a separate PR reformatted style.json.

image

@pathmapper
Copy link
Member

pathmapper commented Dec 13, 2019

Hi @kylebarron thanks a lot for your PRs and comments, I need to take a closer look.

It's impossible to create a small diff because maputnik reformats the JSON automatically.

If you export a style from Maputnik, the style is formatted with gl-style-format:
https://github.com/maputnik/editor/blob/master/src/components/modals/ExportModal.jsx#L6
https://github.com/maputnik/editor/blob/master/src/components/modals/ExportModal.jsx#L40
And the style here
https://github.com/maputnik/osm-liberty/blob/gh-pages/style.json
is formated using the same tool, see #59.

From where did you get the style which you modified in Maputnik?

Edit:
Maybe Maputnik uses a different version of the tool compared to the version used for the style in this repo and there has something changed.

@pathmapper
Copy link
Member

@kylebarron I formatted the style you submitted with your PR with gl-style-format, then there's a small diff.

Could you please do the same, so it's possible to review the changes. This should also make Travis happy, currently the test is failing.

However, we should find out if the Maputnik export is well formatted. It would help if you could describe your workflow creating this PR.

@kylebarron
Copy link
Contributor Author

The workflow is

git clone https://github.com/maputnik/osm-liberty
cd osm-liberty
maputnik --watch --file style.json

then make edits through Maputnik in the browser, and commit the generated JSON

> maputnik --version
maputnik version Editor: 1.6.1; Desktop: 1.0.4

I'd already forked maputnik/osm-liberty, so to make these two PRs without irrelevant changes from my fork, I did

git remote add upstream https://github.com/maputnik/osm-liberty
git fetch upstream
git checkout upstream/gh-pages
git checkout -b protected-areas

I think the two git processes are equivalent?

@kylebarron
Copy link
Contributor Author

kylebarron commented Dec 13, 2019

Also, regarding the PR's styling changes, I think it's too confusing for a general basemap currently:
image

I'd think that I should take labels off completely or only have them visible at a much higher zoom.

Also, I think I should experiment a bit more with opacity, because contrasts look a bit stark.

nst-guide/osm-liberty:master is a topo-oriented fork of osm-liberty (you can see it live here, though only generated for the west coast US). I might incorporate protected areas styling there regardless, but I'm interested in hearing your thoughts on what's best for a generalist basemap.

@kylebarron
Copy link
Contributor Author

When I run

npm install -g @mapbox/mapbox-gl-style-spec
diff <(gl-style-format style.json) style.json

I do get a significant diff. It looks like that has more condensed JSON formatting.

If you could try running the Maputnik 1.6.1 release, and then if you open the style JSON with

maputnik --watch --file style.json

if I do anything, like toggle the visibility of a layer on and off, the JSON is automatically reformatted in the style of this PR

@pathmapper
Copy link
Member

Ahh, you're using https://github.com/maputnik/desktop. I was refering to the online version:
https://maputnik.github.io/editor/

When you export a style with the online version, the style is formatted with gl-style-format.

Opened an issue regarding the desktop version:
maplibre/maputnik#591

@kylebarron
Copy link
Contributor Author

Yes, I downloaded from maputnik/editor, but there was no install, so it makes sense that it was packaged using that golang repo.

maputnik/desktop definitely reformats the JSON in some way, but not with gl-style-format

@pathmapper
Copy link
Member

Also, regarding the PR's styling changes, I think it's too confusing for a general basemap currently

Yep. I think so, too.

I'd think that I should take labels off completely or only have them visible at a much higher zoom.

Yep, worth a try at much higher zoom.

Thanks for mentioning the topo fork, looks great!

I'm interested in hearing your thoughts on what's best for a generalist basemap.

I think the current situation we are having with protected areas for OSM Liberty is not so bad.

For me the two main complaints in #4 are the following:

  1. The green fill color for protected areas could make people think, that there is some grass, wood, etc. but there are cases where is none.

  2. If you have wood and protected areas stacked next to an area with only wood, then the darker green from the stacking is misleading. Have a look at the following GIF: If you only look at the colors, where do you think is wood on the map? Only where the dark green is, right? But in fact both greens are wood.

Peek 2019-12-13 21-00

I would try to style only the outline of the protected areas (use a line layer instead of fill) and add labels for them at high zoom levels.

What do you think?

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.

Styling of protected areas
2 participants