I'm looking at a couple of cafes in Bolton:-

https://www.openstreetmap.org/node/4971453023
and
https://www.openstreetmap.org/node/4971453026

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%20Davros's gravatar image

Mr Davros
61128
accept rate: 0%

1

"sorcery" is an appropriate term. Nobody knows which label Mapnik will choose, and nobody can control it!

(14 Dec '18, 19:23) LivingWithDr...

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

permanent link

answered 13 Dec '18, 10:39

SK53's gravatar image

SK53 ♦
22.0k45228345
accept rate: 20%

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

I guess the label "The Kitchen" collides with the icon of this shop.

(13 Dec '18, 13:19) scai ♦

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 ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×371
×255
×176
×76

question asked: 13 Dec '18, 10:20

question was seen: 294 times

last updated: 14 Dec '18, 19:23

powered by OSQA