Legend size calculation, WMS LegendURL size

Yewondwossen Assefa yassefa at DMSOLUTIONS.CA
Thu Dec 13 10:27:29 EST 2007


Shawn,

  Thanks for doing that. From what I have seen, It seems to be a good 
way of dealing width width/height issue for LegendURLs.
Maybe a simple comment that I had was It might be useful to have an 
optional layer argument in function msLegendCalcSize so that it can  be 
used on one layer or all layers if the argument is set to NULL. This 
would eliminate I think the need for the msWMSGetLegendURLSize function
As Steve noted, It would be good if a ticket was opened for it, and the 
patch can then be applied.

Best Regards,

Shawn Gervais wrote:
> 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, 
> 7.2.4.6.5):
> 
> "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?
> 
> -Shawn
> 


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-dev mailing list