It has been some time since I have looked at the code that generates the
legends, but to my knowledge it simply generates one swatch for each Rule in
the style. Unfortunately there are some cases in SLD where multiple Rules
for the same feature class are simply necessary (ie, for road casing you
usually want to break up the rule across two featuretypestyles to ensure the
draw order is correct.)  So you may find it useful to make a second style
that is more friendly to the legend generator.  In the road casing example,
you'd have a style for actual rendering with two feature type styles each
containing one rule for the stroke, and a legend style with the two strokes
in one rule so the legend generator does the right thing.

It would be nice to have the legend generator inspect the rules across
feature type styles and take this sort of thing into account.  Actually,
it's pretty similar to some of the tricks I have to play in the CSS
community module so I've been thinking about it a bit, I could give you some
notes (and maybe make a Java-friendly API to that code) if you're interested
in doing some Java coding to improve the situation.

--
David Winslow
OpenGeo - http://opengeo.org/

On Mon, Jun 6, 2011 at 2:34 AM, Andrea Aime <[email protected]>wrote:

> On Mon, Jun 6, 2011 at 3:58 AM, Antonio Jose SIlva (Toze)
> <[email protected]> wrote:
> > Hi,
> >
> > I have an sld file composed by a group with two rules. The idea is to
> > symbolize a polygon with a border consisting of a line and that line has
> > some balls spaced on it.
> > The SLD is done, as  you can see below. When I do the GetLegendGraphic
> > the result is two squares for the first rule, the border, the other
> > square for the second rule, represents the balls. The question is there
> > any way to the GetLegendGraphic returns one square with the composition
> > of the two rules?
>
> I'm not sure of what will happen legend wise, but you can put as many
> symbolizers as you want in the same rule. Rework the SLD to have just
> one rule and two symbolizers
>
> Cheers
> Andrea
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax:      +39 0584 962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with
> vRanger.
> Installation's a snap, and flexible recovery options mean your data is
> safe,
> secure and there when you need it. Discover what all the cheering's about.
> Get your free trial download today.
> http://p.sf.net/sfu/quest-dev2dev2
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to