[Tilecache] a couple of possibly silly renderTile API questions

Fredrik Lundh fredrik at pythonware.com
Fri Apr 4 14:30:05 EDT 2008


On Fri, Apr 4, 2008 at 8:07 PM, Christopher Schmidt
<crschmidt at metacarta.com> wrote:

>  I don't have a major problem with that. I'm not really strongly of the
>  opinion that anything other than TileCache.Service.renderTile is a
>  stable API, so as long as it didn't break existing custom backends (I
>  can provide an example if neccesary), I'd be okay with this.

existing backends can continue to return strings, so that should work.
 I'll see if I can prepare a reasonably clean and well-tested patch.

>  > - My second question is a bit more complex: we're rendering data sets
>  > that cover only a small region of the coordinate space, and we can
>  > improve performance a *lot* by rendering larger chunks and then
>  > cutting them up in the renderer itself. I guess you could describe
>  > this as "intelligent metatiling"; instead of having TileCache ask for
>  > a 5x5 metatile or so, our renderer can determine the "best" set of
>  > tiles to produce based on the bounding box for the data source, where
>  > and how the data is stored, etc.  Any ideas on how to best implement
>  > this?
>
>  Nope. It sounds confusing enough I'm not even really sure I understand
>  it, much less how to implement it :)

sorry for that.  what I was trying to say is that my renderer can
sometimes render things more or less "for free", so that instead of
rendering a 5x5 box centered on a given tile, it might decide that
it's a lot more efficient to render, say, a 4x12 box with the
requested tile somewhere in the middle.

>  One idea: if you can 'pre-cache' everything, just build up tiles (using
>  the cache's 'set' method) and use TileCache to serve against them? All
>  that renderTile cares about is "I get the tile back that I asked for"
>  -- everything else that is done by the backend is 'hidden', so you'd
>  just turn metaTile off, do it behind the scenes, and not tell any of the
>  rest of the code.

talking directly to the cache would definitely work, and is probably
good enough for my purposes (at least as long as I'm the only one
using TileCache with this kind of "smart" renderer ;-).  I'll probably
end up duplicating some code from the MetaLayer class, but I guess I
can live with that.

thanks /F



More information about the Tilecache mailing list