[Tilecache] multiple tile requests

Christopher Schmidt crschmidt at metacarta.com
Thu Jan 1 22:38:40 EST 2009


On Thu, Jan 01, 2009 at 05:52:07PM -0800, Matthew Rushton wrote:
> Hi,
>   I was curious if anyone has used/modified TileCache to be be able to
>   request multiple tiles at once. 

I'm not sure what you mean.   

> The need to do this has arisen
>   because of the extremely high latency on mobile phones (for example
>   the iPhone maps app requests multiple tiles at once using a
>   proprietary request format). Http pipelining is possible but it
>   requires too much work on the client side to get right, and on some
>   platforms simply won't work. 

Web browsers simply request multiple URLs at the same time; I don't see
a problem with implementing that for other Mobile applications as well.
As I understand it, Route-Me works against standard HTTP tilesets; I
would assume it uses multiple concurrent HTTP threads for this. 

> Any thoughts on this? I was planning on
>   writing my own apache module to do this but figured I would ask. I
>   think an API involving multiple tiles makes sense, especially in the
>   mobile/high latency world. Thanks!

I guess you want some kind of url from which you can request a set of
multiple tiles to be returned to you? TileCache's extensibility doesn't
quite extend to that level, but it wouldn't be hard to add.
Specifically, you would use:
 
 * A new Service subclass: This would parse the URL, pulling out the
   parameters that tell it which tiles to load.

   For the sake of the next Chunk, i've assumed this is called
   MultiTile, and that any request for multiple tiles also has a
   'multitile=yes' key/value param in the request.

 * A change around line 213 of Service.py, to add a second conditioal
   to the 'list of tiles is an array' case:

    if req_method=="DELETE": xxx
    elif params.has_key("multitile"):
        from TileCache.Services.MultiTile import MultiTile
        return ('application/octet-stream',
                MultiTile(self).serialize(tile)

    else:
        # PIL case 

I would gladly accept this change in trunk given sufficient
documentation of what multitile's 'request parameters' are. (It would
probably make sense to use sets of TMS-Style z/x/y tile identifiers in a
comma seperated list or something similar, possibly encoded in some way
to let you shove more of them into a string.)

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Tilecache mailing list