Ticket #3323 (closed enhancement: fixed)
Support metatiling and buffers in mode=tile
| Reported by: | pramsey | Owned by: | pramsey |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.0 release |
| Component: | MapServer CGI | Version: | svn-trunk (development) |
| Severity: | normal | Keywords: | |
| Cc: | randre@…, pspencer@…, dmorissette |
Description
Using mode=tile currently results in less-than-aesthetic results for any non-trivially labelled or styled layer. The solution is the same as in static cache systems: render to a slightly larger canvas and clip (buffering); render to a much larger canvas and extract (metatiling). Both approaches need to be implemented together, since metatiling alone will retain artefacts along the larger metaboundaries.
In mode=tile, the tiles are of fixed size (256) dictated by the tile APIs, and are organized such that the metatiles are obvious: the 2:1 metatile for a tile is the parent tile in the next highest zoom level; the 4:1 metatile is the grandparent tile in the zoom level two higher.
MapServer currently has a label cache feature that is used by tilecache to provide proper labeling in the presence of buffered images, labelcache_map_edge_buffer. When buffering is turned on in mode=tile, the labelcache_map_edge_buffer will be automatically set to an appropriate inverse value to ensure that labels to not wrap over the metatile edges.
Here is an example WEB object that uses the enhanced support for buffers and metatiles in mode=tile:
WEB
METADATA
"tile_map_edge_buffer" "16" # 16 pixel rendering buffer
"tile_metatile_level" "2" # metatile 2 levels up (4:1 = 1024px metatile)
END
END
The default behavior of mode=tile continues to be no metatiling and no buffering. For top zoom levels (levels 0, 1 and 2) no metatiling will occur.

