-
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
Revised text size for lakes #2302
Revised text size for lakes #2302
Conversation
I am not so familiar with the Mapnik label placement parameters - do these here assure that the center points of offset labels are still within the polygon area? In general with the way_pixels limits it would IMO make sense to further relax the zoom limits, i.e. allow labels for sufficiently large lakes already from z8/z7, maybe with a somewhat raised lower way_pixels limit. |
This would be our first use of |
Kosmtik/TM tends to be worse for metatile issues because it has smaller metatiles. If we don't see too many issues in development it should be fine in production. But this will need testing on Mapnik 2.2 and Mapnik 3.0. |
@math1985
OK I'll revise this parameter and perform tests.
I think that currently no text is shown for lakes with zoom < 10. Surely big lakes like the Great Lakes in North America (as well as Caspian Sea, Black Sea, etc.) need to be managed but would be better with some specific PR. |
1cdf1e6
to
ed3032d
Compare
Can you change the text size logic so it's the same as landcover? See https://github.com/gravitystorm/openstreetmap-carto/blob/master/amenity-points.mss#L1455-L1475 for an example e.g. [zoom >= 9][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
[way_pixels > 12000] {
text-size: @landcover-font-size-big;
text-wrap-width: @landcover-wrap-width-size-big;
}
[way_pixels > 48000] {
text-size: @landcover-font-size-bigger;
text-wrap-width: @landcover-wrap-width-size-bigger;
}
text-fill: darken(@danger_area, 40%);
text-face-name: @bold-fonts;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
} I'm not finding many MT issues, but I did find one in Kelowna This needs more investigation, but I'll do that after the way_pixel MSS changes. It is also disconcerting to see the text size shrink as you zoom in. |
@pnorman: thanks for your review; I'll certainly compare landcover logic through a new update. |
Already discussed here: The idea of considering shrinking text size was to avoid of not showing the text at certain zooms in case of limited space. Anyway, if this is not considered appropriate, I'll remove the text-placements logic. |
ed3032d
to
5c94a24
Compare
Code revised so that the text size logic is similar to the landcover example in amenity-points.mss. Sample images with some lake sizes at different zooms: Note: I used Kosmtik for testing (and found important rendering differences between Tilemill for Windows due to the very different Mapnik versions) |
Is there a reason to not use the exact way_pixel thresholds and values for text-size and text-wrap-width? |
ah, one potential reason is landcover starts at 10px and water at 12. Still, I'd prefer to reuse thresholds and variables when possible. |
Progression used in amenity-points.mss:
Settings previously used for water rendering:
What I did by now was the following:
All next progressions have increased size for a better representation (as far as it looked to me):
There is no particular difference for zooms <=13, but for zooms 14+ the result looks better. Anyway, I will provide a new commit with the exact logic of amenity-points.mss as well as similar samples to allow comparison. |
a63465c
to
6c138a0
Compare
The code has been revised in this second commit, so that the text size logic is exactly the same as landcover in order to allow comparison with the rendering from the first commit. The following images IMHO would confirm that for zooms 14+ the result of the first commit looks better especially for bigger lakes. Images show exactly the same zones of the previous commit (FYI, z9 has been left out as no text is shown). |
…mss#L1455-L1475 Rebased
The logic for water features has been changed following exactly https://github.com/gravitystorm/openstreetmap-carto/blob/master/amenity-points.mss#L1455-L1475
6c138a0
to
292ce8b
Compare
For islands labeling is capped at 800k pixels - it might make sense to do the same for lakes. |
Considering that generally the center of a lake should not be too crowded of data (while an island can host a city), there should be no particular prevention to adopt a bigger font size at high zoom level. In the testing pictures shown above there are four lakes: Lago di Como (biggest), Lago d'Iseo, Lago di Endine, Lago d'Idro. Here are their way_pixels at different zooms: Lago di Como (large):
Lago d'Iseo (medium):
Lago di Endine (small):
Lago d'Idro (small):
By capping way_pixels to 800000, you do not see "Lago di Como" at z13. I would suggest reconsidering my first commit. |
Thanks! |
Revised text size for lakes
[Edited summary]
This PR proposes to scale up the font size for large water area labels (natural=water or landuse=reservoir/basin) used for lakes (currently they are all rendered with a fixed font size, using text-size: 12).
It supersedes and attempts to improve unmerged PRs #2139 and #2287 for the specific relation to the text size used for water areas.