On Tue, Oct 2, 2012 at 1:10 AM, Yancy Matherne
<[email protected]>wrote:

>  Hi all,
>
>  We have a few weather observation layers that include many attributes,
> and we use several TextSymbolizers with custom fonts, rotations, anchor
> points, etc. to generate a complex icon that graphically represents several
> attributes' values at the same time [see attached GetMap]. Unfortunately,
> the GetLegendGraphic service does not generate a useful legend out of the
> box for these styles [see attached GetLegendGraphic]. The icons for these
> layers are so complex that a legend like [
> http://visual.merriam-webster.com/images/earth/meteorology/station-model.jpg]
> would be more useful than a vertical listing of the rules.
>
>  We are looking to patch GeoServer to do two things:
> 1) Point the LegendURL in the GetCapabilities to an ExternalGraphic.
> 2) Implement the LegendGraphic for Rules in SLD.
>
>  I have already started looking into each patch, and I think I have a
> general approach to each.
>
>  1) Capabilities_1_3_0_Transformer.handleLegendURL() already takes a
> LegendInfo parameter, but Capabilities_1_3_0_Transformer.handleStyles()
> always passes in null. I was thinking we could add a LegendInfo to
> StyleInfo to persist the ExternalGraphic information. But I'm not sure on
> the details of this. Would I be able to put the LegendInfo directly into
> the StyleInfo XML file or would there need to a separate file with
> references between them?
>
>  2) The LegendGraphic element in Rules is part of the SLD spec, but it
> does not appear (to me) to be implemented in GeoServer. While using the
> debugger, in BufferedImageLegendGraphicBuilder.buildLegendGraphic(), a
> LegendGraphic that is included in your SLD is accessible by calling
> applicableRules[i].getLegend(). But that never happens in the actual code
> so it never gets used. I was looking to just paint the GraphicLegend there,
> but the shapePainter.paint() method that is used there takes a Style2D
> object and I haven't been able to figure out how to convert a GraphicLegend
> to a Style2D object or perhaps use a different paint method?
>
>  I think these would be useful additions for the whole community and I
> appreciate any feedback or recommendations on this. Part of the tasking is
> to commit this back to GeoServer source.
>
>
Hi,
sorry for chiming in late. I would stay away from LegendInfo, as you
noticed it is not used in the
legend graphic generation and it's probably a leftover.
If you look at its usage, it is referred by a LayerInfo, so it should be
some sort of layer wide
legend: this makes little sense, since a layer can be associated with more
than one style,
eventually in a dynamic way, so a pre-built legend should always be
referenced somehow
by the SLD itself.

The idea of using the Rule legendGraphic sounds good instead, as you said
it's not hooked up
but should not be too hard to implement, just use that one graphic instead
of trying to build
the symbol by looking into the rule symbolizers

Cheers
Andrea

-- 
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to