[Tile-serving] [mod_tile] Bleed (#29)

Stephan Bösch-Plepelits notifications at github.com
Thu May 23 14:51:17 UTC 2013


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 :-)
You can merge this Pull Request by running:

  git pull https://github.com/plepe/mod_tile bleed

Or you can view, comment on it, or merge it online at:

  https://github.com/openstreetmap/mod_tile/pull/29

-- Commit Summary --

  * gen_tile/render(): add a fixed bleed around metatile which will be cut off
  * gen_tile/render(): Set bleed x/y for a map via renderd.conf entry

-- File Changes --

    M daemon.c (16)
    M daemon.h (2)
    M gen_tile.cpp (27)
    M renderd.conf (6)

-- Patch Links --

https://github.com/openstreetmap/mod_tile/pull/29.patch
https://github.com/openstreetmap/mod_tile/pull/29.diff

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20130523/be8ce633/attachment-0001.html>


More information about the Tile-serving mailing list