[Tilecache] getLegendGraphic

Christopher Schmidt crschmidt at metacarta.com
Thu Mar 6 23:46:08 EST 2008


On Fri, Mar 07, 2008 at 11:34:29AM +0700, Chris Brown wrote:
> Are there any plans to add GetLegendGraphic to TileCache? 

No.

> I think this would be useful as often providers only provide access
> through TileCache and not to the underlying WMS, making legends
> impossible. 

What is special about a legend image? It's just an image, right? If so,
is there any reason not to just (when configuring your TileCache layer)
copy the legend output to a specific (static) location? The layer
contents can't change, so I can't see how a legend graphic can change?

> I can't say I'm familiar with the TileCache code but couldn't adding
> such features be just a simple bridge pattern to the underlying WMS?

I'm against adding features like this into TileCache, because I think
it's beyond the purpose of TileCache. TileCache frontends should be
backend agnostic: How do you do, for example, WMS Legends when talking
to a Mapnik layer? How about when you're talking to an Image Layer?
Adding extra methods on the services should only happen when the feature
is available for all the available backends.

I suppose if someone really wanted to argue that TileCache layers should
support a piece of metadata in the config that pointed to a static URL,
and passed that out when a WMS getLegendURL request came in, that
wouldn't be too far above and beyond, but in general, TileCache is not a
WMS, and pretending it is one is somewhat of a fool's errand.

> I'm interested in familiarizing myself
> with the source code and working on this firstly if the community thinks it
> would be of use and secondly if it wouldn't for some reason not be feasible.

It is feasible. With the code in hand, I'd be harder pressed to say no.
However, I'm -0, since I think that this kind of change is not the kind
of thing TileCache is designed for. Grabbing an image and dropping it on
a static file server will have better performance, and in the end,
you'll probably be happier that way. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Tilecache mailing list