Hi,
I prepared a pull request (https://github.com/geoserver/geoserver/pull/641) to solve https://jira.codehaus.org/browse/GEOS-6245
I used some of the suggestions from the following discussion: http://osgeo-org.1560.x6.nabble.com/Getting-the-right-size-for-WMS-LegendURL-widht-height-td5143318.html
In particular, I created a disk based “cache” for sample icons generated in PNG format on demand, with the only purpose to calculate size (for now). The samples are stored in the datadir, aside of the related sld file.
The cache is attached to Catalog events, through a listener watching for style changes (used to invalidate and force a regeneration of the cached sample).
SLD timestamps are compared to sample timestamps only on Geoserver start or catalog reload to take into account eventual external changes to the SLD.
On disk samples could be used (in the future, this functionality is not implemented yet) by the GetLegendGraphic WMS operation to directly return the sample instead of creating a new one when sample generation parameters match the current GetLegendGraphic request.
Thanks
Mauro
–
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
http://www.geo-solutions.it
http://twitter.com/geosolutions_it