On Wed, Mar 11, 2015 at 6:17 PM, Antonio Parrotta <antonioparrotta@anonymised.com
wrote:
Hi all
I have a postgres layer perfectly styled with the colors fetched from a
property "graphic". The layer is dislayed correctly on map.
What I would like to have is the legend as well. This legend should
reflect colors and labels from the styled layer.
I saw that currently geoserver builds the legend from rules in the sld,
but problem is that I have only a single rule. Colors are fetched from a
property field using ogc.
is there a way to have such legend that retrieve colors and labels from
properties instead of rules
Not at the moment, to do that we would need to figure out all possible
values and all possible values
combinations (in case of multiple properties used in the SLD) which in the
worst case would require
a visit of the entire source data set (which again, in general, is not
feasible because that data set
might be huge).
I believe we have a pull request incoming that will make it possible to
give GeoSErver a pre-built
legend to be used in GetLegendGraphics, which should fit well your case.
Or... well I guess we could implement some way to do the actual data full
scan (with distinct value
extraction when there is a single attribute involved), but we'd need to
find a way to make sure
it does not turn into a performance killer... like caching, or making it
something only the admin
can run and save the results as a pre-cooked legend, or save somewhere the
data distribution
summary and have the legend be built on the fly from that summary, avoiding
to read the whole
dataset (issue, this summary can get out of synch with the data).
Would be interesting work, if we can find funding to sponsor it.
Cheers
Andrea
--
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 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
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------