-
Notifications
You must be signed in to change notification settings - Fork 831
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] Improve country/state label rendering #3056
[WIP] Improve country/state label rendering #3056
Conversation
* Stop rendering country/state labels slightly earlier * Scale country/state labels with country/state size instead of with zoom level (similarly to landcover labels) * Set text-wrap to a constant em
For me the idea of different country size labels is OK, but I feel strange with different label size of states, even if the look is not too bad - I need some time to judge it with a cool head, probably. First batch of rendering - Poland, of course 😃 (click to see full size images), it looks OK for me. For such country size <z6 doesn't make sense, because no state labels are visible yet, so: |
A bit unfortunate that Wielkopolskie is the only state that surpasses the threshold. I think it will look less bad when there are other countries around where the label size is also variable. |
Mazowieckie would be the same if not the problem with country admin center city eclipsing it (that's a story with Mapnik option |
I know the intentions are good but the result is misleading and confusing. Admin regions, unlike ad-hic landcover areas, are well structured and IMHO labels should reflect that, that is, use a single label format for all regions at the same level of hierarchy. Technicalities aside, this is going to upset many people. Prepare for a bucket load of bug reports questioning this design. BTW, did you have a chance to look at #3034? There's an inconsistency in the way large city names and region names are ordered, affecting most countries (later on I found more examples in in countries like France, I initially thought it didn't have that issue). The Mapnik fix kocio-pl motioned is going to to improve the situation a bit (just like manual placement would) but it is not a fix, as there will still be collisions. I thought "Stop rendering country/state labels slightly earlier" may have something to do with the above issue but there was no difference in screenshots with respect to the ordering. |
This PR is included in the global rendering demo at http://bl.ocks.org/matthijsmelissen/raw/af7a602c222dbf1ff1a2c0d84ed755b7/. See for example Brazil where there are large differences in state sizes. To me, the different size rendering looks good, and I have no problem rendering states in different font sizes. As far as I'm concerned this can be merged. @kocio-pl what do you think? |
I have to compare it with #2851 - I think it should be no label-less areas on low zoom, if possible, abd more aggressive filtering of big areas might produce more such "holes".
I think it's great for the countries (it may even help with the holes I mentioned above!), but I don't like the effect on states.
OK. |
How about ordering (not filtering) labels by country/state size instead? This way the biggest areas would be the most likely to have their labels rendered, while the smallest ones would likely not fit at low zoom levels. |
text-size: 12; | ||
text-wrap-width: 45; // 3.8 em | ||
text-line-spacing: -1.2; // -0.10 em | ||
[way_pixels > 12000] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a mistake to adjust the text labels based on way_pixel instead of by admin_level. This over-emphasizes areas at high latitudes (where way_pixels is 2 to 4 time larger than way_area at the equator) and over-emphasizes large provinces over small countries.
text-wrap-width: 50; // 4.5 em | ||
text-line-spacing: -0.6; // -0.05 em | ||
text-margin: 7.7; // 0.7 em | ||
[way_pixels > 12000] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines will make large provinces/states render more prominently than small countries - with "large" and "small" depending on mercator projection as much as actual size.
@@ -4,34 +4,22 @@ | |||
@state-labels: desaturate(darken(@admin-boundaries, 5%), 20%); | |||
|
|||
.country { | |||
[zoom >= 3][way_pixels > 1000][way_pixels < 360000] { | |||
[zoom >= 3][way_pixels > 1000][way_pixels < 192000] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change would require changes to the way_pixels limit in #admin-text
so that they match for; currently [admin_level = '1'][way_pixels >= 360000], [admin_level = '2'][way_pixels >= 360000],
would need to change to [way_pixels >= 192000]
@@ -43,22 +31,27 @@ | |||
} | |||
|
|||
.state { | |||
[zoom >= 5][way_pixels > 3000][way_pixels < 196000] { | |||
[zoom >= 5][way_pixels > 3000][way_pixels < 192000] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would approve of this minor change, but #admin-text
needs to be changed to match [admin_level = '4'][way_pixels >= 196000] currently, would need to change to [way_pixels >= 192000]
@matthijsmelissen were you planning to work on this PR, or close it? |
Closing as stale. |
level (similarly to landcover labels)