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

Fixing country labels on z4 #3353

Merged
merged 2 commits into from
Sep 20, 2018
Merged

Conversation

kocio-pl
Copy link
Collaborator

Fixes #2851

Changes proposed in this pull request:

  • Removing upper country size limits on z3-z4, to allow showing missing Canada and Russia labels

@rrzefox Could you test this fix on your server?

@rrzefox
Copy link

rrzefox commented Aug 20, 2018

this has been deployed and z3-z4 rerendered.

@kocio-pl
Copy link
Collaborator Author

Thanks!

Testing link (positions might be different, since OSMF servers use new Mapnik with different labels placing algorithm):
http://bl.ocks.org/matthijsmelissen/raw/af7a602c222dbf1ff1a2c0d84ed755b7/#4.00/64.96/-93.61

All the missing country labels on z4 are now visible (the names of islands indicate that we're really on z4):

Canada
screenshot_2018-08-20 screenshot

Greenland
screenshot_2018-08-20 screenshot 1

Russia
screenshot_2018-08-20 screenshot 2

@kocio-pl kocio-pl changed the title Fixing country labels on z4 [WIP] Fixing country labels on z4 Aug 20, 2018
@matthijsmelissen
Copy link
Collaborator

To be honest, I prefer the old rendering. There was a reason not to render labels on such huge areas: it is really hard to see what area the label belongs to. Especially because the label is so small compared to the country. And if we're already zoomed in so far, I'm not even sure if users are still interested in the country name.

@kocio-pl
Copy link
Collaborator Author

Yes, I remember your position and I understand it.

For me such a large area without even a single label lacks consistency. The zoom-in logic for me is following: a blank page -> country names level -> states names level. Without this fix there's a blank page between "country level" (z3) and "states level" (z5) and for me it's disturbing.

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented Aug 20, 2018

Quoting from #2851 (comment):

The reason is that by the time you're zoomed in so far, you should already know which country you're looking at, and smaller detail is more important to be rendered.

I agree with this sentence. Yes, I know what country it is. My problem is that on z4 the are no smaller details yet (they are rendered from z5) and this gap is strange for me. Only 2-3 countries behave like that and it seems like special exception: we have plenty of space for rendering, but we abstain from it.

@kocio-pl
Copy link
Collaborator Author

Another thing that I just saw: without country labels cities like Moscow or Ottawa lack some context for that name (there are only country boundaries).

@kocio-pl
Copy link
Collaborator Author

I see also similar problem with some Russian states: they should be visible from z5, but they are too big already, so their name is never shown, even if we have plenty of space. And there are also capitals inside them which lack some context. Example - Krasnoyarsk Krai:

https://www.openstreetmap.org/relation/190090#map=5/70.656/99.031

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented Sep 7, 2018

My current code has a side effect that the name of a "big" country is rendered even on z4+. Could somebody help me to fix it?

@matthijsmelissen
Copy link
Collaborator

Also on z5 for small countries, the condition [zoom >= 3][way_pixels > 1000] is true.

Maybe you should start with something like [zoom >= 3][zoom < 5][way_pixels > 1000], [zoom >= 5][way_pixels < 360000].

@kocio-pl
Copy link
Collaborator Author

Thanks, @matthijsmelissen, this sounds like a good solution. @rrzefox Could you apply the fixed code?

@rrzefox
Copy link

rrzefox commented Sep 12, 2018

the current version of this PR has been deployed and Z2-Z6 rerendered.

@kocio-pl
Copy link
Collaborator Author

Thanks! On z2-z6 it works OK, I will test it also on higher levels to know if country labels on z5+ are disappearing properly.

@kocio-pl kocio-pl merged commit 9d9f32b into gravitystorm:master Sep 20, 2018
@kocio-pl kocio-pl deleted the country-labels-z4 branch September 20, 2018 03:20
@kocio-pl kocio-pl mentioned this pull request Nov 4, 2018
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.

Country label problems
3 participants