openstreetmap/mod_tile — pull request #29 by plepe (2013-05-23 14:51:15+00:00)
Title: Bleed

When using TextSymbolizers with Placements, it may happen that labels for objects near the metatile edge are dissipated or duplicated as the Placement algorithm achieves different results for the left and right (or upper and lower) metatile. Here's an example from a project I'm working on right now:

![mod_tile_bleed_before](https://f.cloud.github.com/assets/249012/555115/d4865ee6-c3b7-11e2-9416-54de9e889ecc.png)

It's an overlay for public transportation routes based on OpenStreetMap data. The left part is a right-most tile of a meta tile, the right part a left-most tile of the adjacent meta tile. As you can see, the label "Franzensbrücke" is printed on both tiles. This happens for (almost) all objects which cross the boundary.

I solved this problem by introducing a ["bleed"](http://en.wikipedia.org/wiki/Bleed_%28printing%29): An area which will be rendered but trimmed when splitting the meta tile into its parts. You can configure the bleed for each map in renderd.conf (an amount of pixels, default: no bleed).

Here's an example with a bleed of 256px:
![mod_tile_bleed_256](https://f.cloud.github.com/assets/249012/555117/e7182b84-c3b7-11e2-95fa-7a14310ca92b.png)

You may choose to use a different bleed for the vertical and horizontal axis, as (in my example) the bleed depends on the extent of the labels. In the example above the labels are always horizontal texts, therefore horizontal bleed needs to be way larger.

Here's the example again with a horizontal bleed of 128px (which is apparently to small):
![mod_tile_bleed_128](https://f.cloud.github.com/assets/249012/555119/ebc441cc-c3b7-11e2-8cf9-846fdc0cff59.png)

I guess this is a nice addition to the features of mod_tile/renderd :-)