There are just times when best approach to legend is to make simple versions 
covering what you need, screenshot, then take them into a good image editor and 
make them pretty. Add the composite pretty output to the style with the Add 
Legend button.

From: Davide Battista <[email protected]>
Sent: Saturday, 12 December 2020 04:15
To: [email protected]
Cc: GeoServer Mailing List List <[email protected]>
Subject: Re: [Geoserver-users] GetLegendGraphic - Multiple Rules are not 
properly rendered.



Note: External sender:
Thanks Andrea for the helpful advice!


Regards


Davide


On Fri, Dec 11, 2020 at 3:07 PM Andrea Aime 
<[email protected]<mailto:[email protected]>> wrote:
Please keep the list in CC at all times. This is part of the list guidelines, 
which I recommend reading if you haven't
done so yet: http://geoserver.org/comm/userlist-guidelines.html
It's also linked from the footer of all mails posted to this list.

On Fri, Dec 11, 2020 at 2:49 PM Davide Battista 
<[email protected]<mailto:[email protected]>> wrote:
So you should fix the documentation at least.

LOL no, if you care about getting the doc fixed, you must do it. Each page in 
the documentation has
an edit link that will create a PR for you. I warmly suggest looking at this 
presentation before
any further comment on the matter:

https://media.ccc.de/v/bucharest-322-the-secret-life-of-open-source-developers


Anyway, I dig into the code and I found something that ooks weird to me, but 
for sure I'm wrong:

In the LegendUtils file 
(https://github.com/geoserver/geoserver/blob/2.11.4/src/wms/src/main/java/org/geoserver/wms/legendgraphic/LegendUtils.java)

That's an outdated version of the source code, using deprecated API (getRules) 
that was turned into "rules()" a few years later. Let's look at the current 
source code:
 
https://github.com/geoserver/geoserver/blob/master/src/wms/src/main/java/org/geoserver/wms/legendgraphic/LegendUtils.java#L562

Because looking at the code, there is no reason for not rendering both the 
rules.

I already pointed you at the class that builds the full legend in case there is 
a raster symbolizer in the style.
The legend utils code you were looking at is used only for vector data legends:
https://github.com/geoserver/geoserver/blob/master/src/wms/src/main/java/org/geoserver/wms/legendgraphic/BufferedImageLegendGraphicBuilder.java#L189

while this branch is chosen for raster legends:
https://github.com/geoserver/geoserver/blob/master/src/wms/src/main/java/org/geoserver/wms/legendgraphic/BufferedImageLegendGraphicBuilder.java#L175

Regards
Andrea


== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V 
for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions 
S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: 
+39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it 
http://twitter.com/geosolutions_it 
------------------------------------------------------- Con riferimento alla 
normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento 
generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza 
inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è 
un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, 
ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene 
notizia. This email is intended only for the person or entity to which it is 
addressed and may contain information that is privileged, confidential or 
otherwise protected from disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or 
the information herein by anyone other than the intended recipient is 
prohibited. If you have received this email by mistake, please notify us 
immediately by telephone or e-mail.

Notice: This email and any attachments are confidential and may not be used, 
published or redistributed without the prior written consent of the Institute 
of Geological and Nuclear Sciences Limited (GNS Science). If received in error 
please destroy and immediately notify GNS Science. Do not copy or disclose the 
contents.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to