[Tilecache] TileCache, a fast Tile Server

Christopher Schmidt crschmidt at metacarta.com
Wed Aug 29 20:36:23 EDT 2007


(I'm responding to the TileCache list as well, since your email didn't
seem to have any private information, and my reply is generally useful.)

On Thu, Aug 30, 2007 at 11:45:11AM +1200, Mike Oberdries wrote:
> I recently read your post at 
> http://lists.burri.to/pipermail/geowanking/2006-December/003298.html .
> It was a great little summary and I found it most useful.
> 
> I wonder if I could pass a related question by you ... we run UMN
> MapServer and currently cache using a Squid Proxy.  One of our main
> issues with our MapServer / Squid caching implementation is around label
> truncation along cache-tile boundaries.  For example, we have a large
> road network which is labelled by road name.  The road name labels that
> are coincident with the cache grid get truncated during  rendering
> leaving an ugly caratographic effect in our WMS

Well, the first stpe to solve this is entirely within MapServer: you
want the "PARTIALS FALSE" option on your MapServer label configuration.
Doing this will prevent MapServer from creating labels over image
boundaries -- but at that point you will likely see underlabeling due to
the number of tiles used in a typical tiled map. (Bigger tile sizes
would limit that problem to a certain extent.)

> One workaround would be to render a single seemless mosaic and then chop
> this up by tile-grid later on.  However, the number of tiles and zoom
> levels we have mean this is not viable.  If you have any insights on the
> subject or if TileCache has a workaround I would be grateful for any
> feedback?

TileCache supports metaTiles to do what you're envisioning. However,
instead of drawing one tile for the entire world, TileCache works in
smaller chunks, drawing one 'big' 5x5 tile with a 10px border around it.
When you do this, you can tell MapServer not to draw any labels in the
last 10px via the map_labelcache_edge_buffer metadata.

Then, you'll have labels which span up to 5x5 tiles, and the labels will
be not cut.

Note that the default is 5,5 tiles per metatile. This is configurable. However, 
MapServer has a compiled in limit of image size of 2048 x 2048, which
means that hte maximum number of 256px square tiles is 7x7 (including
the metaBuffer pushes it over the limit at 8x8). If you change the limit
in MapServer, I have heard reports that the performance for pre-caching
is great (though this was reported with ka-Map, rather than with
TileCache specifically). In general, the bigger of an image you can
provide, the less overlabelling you will see (due to shared polygons and
the like), and you'll get higher overall performance: 4 small 256x256
image renders takes approximately 3 times as long as one big 512x512
render in many simple rendering situations. (Of course, all of this is
dependant on your specific data and cartographic rules.)

In general, TIleCache's metatile support works pretty damn great: you
can see an example with 7x7 metatiles on http://boston.freemap.in/ . I
would highly recommend using it to anyone who can provide a client which
reads tiles according to a pre-cached scheme, whether you generate them
with TileCache or not -- and obviously, given that Schuyler and I took
the time to write it, I feel that TileCache is a great piece of software
to use for the task :)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Tilecache mailing list