I'm looking at a couple of cafes in Bolton:- https://www.openstreetmap.org/node/4971453023 Both are on the same building block and both are tagged exactly the same way, i.e.amenity = cafe and name = whatever. However one cafe title renders at zoom level 18 (The Kitchen) and disappears at level 19, with other (The Bolton Town Coffee) only appearing at level 19! Can anyone explain how this is happens? Thanks. asked 13 Dec '18, 10:20 Mr Davros |
It's the Mapnik label collision algorithm. A web search for this term produces a reasonable number of hits, such as this one. When more than one label exists in the same space it will choose one of them to render. As the algorithm works independently for each individual tile there is no reason why one POI will always be guaranteed to appear. This is particularly true when additional labels may be present at one zoom level and therefore the label clashes will themselves be different. Another factor is differences in font size between layers answered 13 Dec '18, 10:39 SK53 ♦ It's worth mentioning that I've noticed (in a different map style) far more problems with names disappearing in recent Mapnik versions than previous ones. Not all seem to be related to label collisions (though it looks to me like yours is) - the issue seems to be with label placement relative to the icon and no amount of text-dy tweaking to move it away seems to resolve the issue. Incidentally you appear to have one of the cafes twice - see here.
(13 Dec '18, 10:49)
SomeoneElse ♦
Thank you. That's a good, understandable explanation re what happens at level 18. However, why would "The Kitchen" appear at 18 yet disappear at 19? There isn't any other labels being rendered around it, so it's surprising to see that label disappear. (I also saw that duplication of one of the cafes, thanks)
(13 Dec '18, 13:10)
Mr Davros
Ah, ok got you - so even though that shop has no name (and therefore no title), Mapnik is doing some process whereby it works out a reserved width for the shop label and considers it would clash with the cafe. I guess there should be an additional rule to check if that shop was actually named before calling out a clash or maybe it's just the shop "The Money Shop" on the other side causing the clash. Either way that all makes sense to me now. Thanks everyone for all the help!
(13 Dec '18, 13:51)
Mr Davros
I don't think it is a "reserved width" but really the shop icon, i.e. the pink dot.
(13 Dec '18, 13:57)
scai ♦
|
"sorcery" is an appropriate term. Nobody knows which label Mapnik will choose, and nobody can control it!