-
Notifications
You must be signed in to change notification settings - Fork 820
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
Administrative boundary text labels are displayed inconsistently #3649
Comments
Also, when two admin levels share the same way, the names are often too close together. This can be confusing when one of the admin levels has a multi-word name, eg Jayawijaya (admin_level 5) & Aso Tipo (admin_level 6) (screenshot from kosmtik): |
The french style has a well-developed rendering for administrative boundaries which addresses most of these issues, and also displays province and national borders sooner:
It would be a good idea to try Normally I'm also interested in testing display of the text border labels at earlier zoom levels. The French example seems to be fine-tuned for French admin levels, but I believe text labels could be shown for admin_level=4 at >= z12 or z13, and admin_level=6 at z14 or z15. |
OK, I spent most of yesterday feeling frustrate that text-spacing: 750 was not rendering the labels less often than about every 300 to 500 pixels in my test renderings (kosmtik with docker). And my test images with the current master branch were not the same as screenshots from openstreetmap.org I finally realized that the metatile size is 512 by 512 pixels when testing, but the servers at openstreetmap.org use a much larger metatile size. The labels are repeating every metatile, even without Does anyone know the tile size used for openstreetmap.org? @pnorman? This wiki page, which may be outdated, suggests 2048 x 2048 pixels, which would probably lead to one border label every 1600 to 2200 pixels (depending on the orientation of the border) on average https://wiki.openstreetmap.org/wiki/Meta_tiles How can I change the settings on my test server to match this metatile size? Edited: I figured out one option. Changing EG: Kosmtik rendering with 512px meta-tiles (master branch): Kosmtik rendering with proposed changes ( Screenshots from openstreetmap.org (with much larger meta-tiles) |
Hhmm really interesting. I always thought Kosmtik looked a little off. I always thought it was a slight difference in how zoomed in things are at a particular zoom level. Its possible the tiles are slightly stretched though. |
Those renderings at 50% (zoomed out) look odd because my browser did not do
a good job at the edges between tiles
…On Sun, Jan 20, 2019 at 12:05 PM Adamant36 ***@***.***> wrote:
Hhmm really interesting. I always thought Kosmtik looked a little off. I
always thought it was a slight difference in how zoomed in things are at a
particular zoom level. Its possible the tiles are slightly stretched though.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3649 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoxshOHIRPWH07ZLTxM6dQaZpmxps09nks5vE9zkgaJpZM4aH8NX>
.
|
Code to change metatile size in localconfig.json:
|
Code to change metatile size in localconfig.json:
Thank you, that will be easier to maintain.
…On Sun, Jan 20, 2019 at 9:53 PM vholten ***@***.***> wrote:
Code to change metatile size in localconfig.json:
[
{
"where": "metatile",
"then": 8
}
]
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3649 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoxshBy-nn1PZ7pFo8iRS9V_wcZ2WZ4Mks5vFGa9gaJpZM4aH8NX>
.
|
I believe I understand why the border labels are repeated several times in a row in some cases. It seems to be a Mapnik bug related to polygons and metatiles. This happens where a small segment of border crosses into and then back out of the metatile, so there are two different sections of the border in the same metatile, but they are disconnected. Mapnik appears to use the entire length of border in the metatile to calculated how many labels should be placed. So if the spacing is set at 750 pixels and the total length of border in the metatile is 2500 pixels, then it attempts to place 3 text labels along the border. But it only attempts to place them along one of the segments. Often this is the shorter segment rather than the longer, which can lead to 3 or 4 labels in a row. It is difficult to show examples, since you need to see the whole 2048 x 2048 pixel metatile to understand, but here is a screenshots of the results, with the metatile bounds shown: https://www.openstreetmap.org/#map=17/-4.08183/138.95416 If you try rendering this with Is this something that could be fixed in Mapnik? |
@talaj What do you think of that? |
This seems like a bug with |
This seems like a bug with `text-clip: true;`
Thank you, I will test changing this!
However, I am concerned that rendering performance could be worse if
geometries are not clipped. @pnorman ?
|
#3652 has been merged, fixing most of the problems reported in this issue. However, since we couldn't yet use |
We've turned off clip in the past for lots of stuff. We need it for anything with dashes. Do we know it won't work on text from boundary polygons? |
We’ve turned off clip in the past for lots of stuff. We
*need* it for anything with dashes. Do we know it *won't* work on text from
boundary polygons?
This was tested in PR #3652 - see this comment
https://www.github.com/gravitystorm/openstreetmap-carto/pull/3652#issuecomment-457586484
It was 2 to 10 seconds slower per metatile to render areas near very long
borders (eg Poland admin_level=2), at least on my laptop. Smaller borders
were only a second slower.
Then @talaj said that he had a way to optimize text rendering on huge
geometries, so hopefully this will be improved in Mapnik.
|
Expected behavior
Actual behavior
Likely cause and solution
text-spacing:
ortext-repeat-distance:
as used for roads and waterways. Adding these missing properties should improve the renderingLinks and screenshots illustrating the problem
Near Wamena, Papua, Indonesia (Screenshots)
https://www.openstreetmap.org/#map=17/-4.07715/138.97202
https://www.openstreetmap.org/#map=17/-4.08183/138.95416
Damhead Railway, Northern Ireland (_Screenshot from openstreetmap.org)
https://www.openstreetmap.org/#map=17/55.11269/-6.59828
Canberra, Australia (Exported from Kosmtik):
The text was updated successfully, but these errors were encountered: