Legend size calculation, WMS LegendURL size

Steve Lime Steve.Lime at DNR.STATE.MN.US
Wed Dec 12 19:56:50 EST 2007

Hi Shawn: Thanks for the contribution! Should probably create a ticket and attach the
patch there. I can apply but I'd like to hear from some of the OGC gurus out there first
as this is not my area of expertise.


>>> Shawn Gervais <project10 at PROJECT10.NET> 12/11/07 4:40 PM >>>
Hi devs,

I have attached a patch which:
	- Refactors legend size calculation out of msDrawLegend and into its 
own function
	- Uses the legend size calculating function to better estimate the 
height/width of LegendURLs advertised in GetCapabilities responses

There seems (to me) to be some ambiguity in the WMS specs regarding 
LegendURL. WMS 1.3.0 clears this up a lot, and states (03-109r1,

"Servers should provide the width and height attributes if known at the 
time of processing the GetCapabilities request."

And WMS 1.3.0 makes those attributes optional. However, under WMS 1.1.1 
MapServer advertises a GetLegendGraphic-using OnlineResource for the 
LegendURL, but provides dimensions that are only sufficient for drawing 
the legend 'key', but not the label.

Of course, the dimensions will (potentially) be incorrect if the client 
issues RULE or SCALE parameters, but they should be correct for the URL 
that is advertised.

Any comments? Flames?


More information about the mapserver-dev mailing list