OpenStreetMap

A map painter's guide to label placement

Posted by imagico on 19 May 2018 in English (English)

Warning: this post contains irony that might not be immediately obvious to all readers.

So you are an OpenStreetMap mapper and consider the task of the mapper to be to draw the map. All this talk of a generic geo-database and we don't map for the renderer sounds like esotheric nonsense to you. OpenStreetMap is a map. Mappers create this map. Period.

But map style designers make life really difficult since your mapping work is interpreted in a way that makes it hard to properly draw things on the map.

This in particular applies to labels. Sometimes you just need to draw a label somewhere. Here you learn how you can do this without also having other stuff show up in the map that you don't want.

The classic method to do this is using place=locality. This is really nice because place=locality just means an unpopulated place with a name but no other verifiable properties. This means it cannot be easily falsified without local knowledge meaning it is fairly unlikely that another mapper will come along and remove your label because it does not actually describe something verifiable on the ground.

The big disadvantage of place=locality is that it is not rendered before zoom level 15 and you have no way to influence the label design.

A much more powerful tool for label placement is place=island. Large polygons tagged place=island are drawn with a label (and only with a label) starting at zoom level 4 already and the label size depends on the size of the polygon. This mean you can use this to place a label anywhere on the map in a wide range of sizes just by drawing a suitably placed and sized polygon and tagging it place=island + name=whatever.

place=island neutral labels from z4 upwards

The big disadvantage is that this is very easy to falsify. What an island is is very well defined. Using this tag for other things will, in particular if the feature is large and prominent, quickly be reverted as vandalism.

The next method for placing labels is to use shop=mall which creates red labels starting at zoom level 10. This has more or less the same disadvantage as place=island - if it is used on things that are not actually malls this can easily be seen on high resolution images - outside of settlements it is often obvious without consulting images at all.

A bit less of this problem comes with tourism=attraction, likewise starting at zoom level 10 but with a different styling and in dark magenta. Meant as a secondary tag to indicate something is of touristic significance (which in itself is obviously difficult to falsify) it is rendered as a primary tag independent of the type of feature it is applied to. It is therefore much more popular than shop=mall for labeling - despite the duller color (see here, here, here and here for examples).

place=island colorful labels from z10 upwards with shop=mall and tourism=attraction

And finally since recently we also have a way of generating blue labels without at the same time generating other visual clutter. This is completely unrestricted in terms of zoom level (i.e. you can even place a label on zoom level 0 if you want to).

To do so you once again need a polygon (a closed way or a multipolygon relation) and tag it natural=bay + name=whatever. This is easy to falsify if the polygon extents over land but it is just about as hard to falsify as place=locality for polygons over water and does not have the zoom level and size restrictions of that.

place=island ...and the easiest way to spam OSM so far

And in case you are hesitant to use this because verifiability of mapping might seem not such a bad idea in the end - don't be afraid, you are not alone. Here a few examples:

Some prefer to use natural=water to natural=bay - this has the disadvantage of being rendered with a solid color fill, which of course does not matter much if you use it only over water - at least in the standard style. And it is not rendered before z5. But it has been possible to use that for much longer for label placement over water so it is quite popular as well:

As a data user i can just sigh and contemplate on how to reliably normalize these free style drawings into properly placed nodes which then can hopefully be used to interpret the data with the help of verifiable geometries like the coastlines. This would be funny in its irony if it wasn't so sad because of the work hours wasted in mapping and data maintenance for nothing.

Comment from Wakanda4ever on 20 May 2018 at 04:49

Cool, thanks for the info :D

Comment from Warin61 on 20 May 2018 at 06:11

"There be Dragons" :)

Your not alone, many people work at getting a good map. Removing idiocies is one thing .. but there are far more simple errors.

Comment from dieterdreist on 30 May 2018 at 13:01

great read, although I partly agree with Warin61, these are problems you have to search for, needles in a hay stack, these are potentially more dangerous because they are put on purpose, unlike the many "simple" errors that are entered because of a lack of knowledge or concentration or experience or a good tool.

Login to leave a comment