NOTICE: is being shutdown on 1st March 2024. Please use the OpenStreetMap Community Forum

I'm getting cut labels on my maps. Same thing is happening on the main map here:

(look between Coventry and Rugby)

Anyone know how to fix them?

I made a dynamic tileserver with Mapnik, renderd and Apache mod-tile. Also made a static one with Mapnik and to make the tiles. Same thing is happening in both cases.

Did some research and discovered that the problem is caused by not having a buffer around the rendered tiles. So I stated a buffer size in my main xml style file (osm.xml):

<Map background-color="#b5d0d0" buffer-size="128" srs="&srs900913;" minimum-version="2.0.0">

Did so for the dynamic and the static servers. Made no difference. Tried different sizes for the buffer: 256, 1024, made no difference. I know osm.xml is being loaded because every time I edit it I change the background colour and I can see the new colour in newly rendered tiles.

So Mapnik is reading osm.xml but apparently ignoring the buffer size. Why so?

Thank you.

asked 26 May '14, 18:12

Charles%20Sweeney's gravatar image

Charles Sweeney
accept rate: 0%

Fixed it myself. Not sure if it's the "correct" solution but it works very well for me and gets rid of all the cut labels.

Used "avoid-edges" in the xml.

On the dynamic server (Mapnik, renderd, mod_tile):

Edited the main xml file /etc/mapnik-osm-data/osm.xml

Added the "avoid-edges" parameter with a value of "true" to every instance of the <ShieldSymbolizer> tag (13 of them). So for example, this line:

<ShieldSymbolizer size="10" fill="#fff" placement="line" file="&symbols;/mot_shield[length].png" spacing="750" minimum-distance="30" fontset-name="bold-fonts">[ref]</ShieldSymbolizer>


<ShieldSymbolizer size="10" fill="#fff" avoid-edges="true" placement="line" file="&symbols;/mot_shield[length].png" spacing="750" minimum-distance="30" fontset-name="bold-fonts">[ref]</ShieldSymbolizer>

After editing, stop and start renderd:

/etc/init.d/renderd stop

/etc/init.d/renderd start

You can go to a new area of the map to see newly generated tiles to see the effect of the changes. In my case on a test server I deleted ALL existing tiles, then went onto the map again, getting every tile fresh.

The tiles are here (on my setup):


To delete all the tiles, delete the "default" directory:

cd /var/lib/mod_tile/

rm -fr default

The "default" directory is automatically created again the next time a tile is rendered.

I was delighted with the result. My worry was that there would be more labels and pairs of labels where there was previously cut labels, but to my pleasant surprise there was the same number of labels as before but those that were previously cut had been moved slightly (within the edge of the tile) and displayed perfectly!

Still had buffer-size="128" in the <Map> attribute, though not sure if that is necessary as it didn't appear to make any difference there.

permanent link

answered 27 May '14, 15:58

Charles%20Sweeney's gravatar image

Charles Sweeney
accept rate: 0%

similar solutions for the label cutting problem are discussed in this video, but for CartoCss

(27 May '14, 17:17) escada

Hi. I applied the solution above, but I am still having road labels being a little cut off. Why is this and can I fix it ?

alt text

permanent link

answered 06 Apr '17, 23:51

Koles500's gravatar image

accept rate: 0%

The answer at suggests that you might have been using the old pre-carto style. If you are, then there are two things that you're doing differently to "most people" (the other is running this on Windows). My guess is that your problem here is related to something that you're doing differently - perhaps try a more recent map style, or the same style on differently-built version of Mapnik (for example just fetches from a repository so there's less to go wrong).

(07 Apr '17, 00:09) SomeoneElse ♦

We have newest mapnik tools that I downloaded from SVN repository. I can try different style. Which one exactly do you suggest? Maybe this one : ?

(07 Apr '17, 14:04) Koles500

I downloaded style from and compared it with my usual file and they are exactly the same. I re-imported data and re-rendered tiles and the problem is still the same as shown above. Any ideas ?

(12 Apr '17, 15:53) Koles500

As mentioned elsewhere, the "" file just determines what columns are imported, not what map style you get. That file is usually called "mapnik.xml". To take one example of how that is created see up to where it says "carto project.mml > mapnik.xml". In that example the "source" for the style is in the files referred to by "project.mml" and "carto" converts that into "mapnik.xml" which is something that Mapnik can understand (but most humans can't).

To compare non-carto map styles you'd need to compare the mapnik.xml files, but that will be difficult because the file format is very difficult to understand.

(12 Apr '17, 16:36) SomeoneElse ♦

Finally, I fixed it! <Map buffer-size="512" AND <ShieldSymbolizer clip="false" instead of <ShieldSymbolizer avoid-edges="true" (all occurences) in osm.xml worked.

permanent link

answered 12 Apr '17, 16:54

Koles500's gravatar image

accept rate: 0%

edited 12 Apr '17, 16:55

Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 26 May '14, 18:12

question was seen: 8,781 times

last updated: 12 Apr '17, 16:55

NOTICE: is being shutdown on 1st March 2024. Please use the OpenStreetMap Community Forum