On Friday 18 April 2008 02:56:24 pm Andrea Aime wrote:
Justin Deoliveira ha scritto:
> Hi Daniel,
>
> I see the issue... so it appears that the legend producer is simply
> producing an entry for every single rule in the sld. What you need is to
> group rules by there scale. Interesting.
>
> I would have too look into this to see if its possible... should be. I
> think it makes sense to perhaps make this a "format option" you can turn
> on and off.
>
> Daniel, do you want to create a jira task for this?
>
> What do other developers think?
Having a way to generate a per scale legend seems like a good idea.
Yet from the sample he attached it seems it's more than just that,
we would need to create the composite symbols that the map is generating
due to the usage of multiple feature type styles... Figuring out the
possible combinations out of the rule conditions would seem pretty hard.
Not sure we can actually automate that (suggestions?
)
Hi, chimming in...
Daniel, what request are you using to get that result?
It seems to me the behaviour you're looking for is just the default one (and
the one from the sld spec).
What GeoServer does is the following:
- If the GetLegendGraphic request includes a RULE=<ruleName> parameter, a
graphic for that specific rule is generated
- otherwise, it tries to figure out which rules apply to the request scale,
and produces a legend graphic for each rule that applies.
The concrete code is like this:
final Rule applicableRules;
final double scaleDenominator = request.getScale();
if (request.getRule() != null) {
applicableRules = new Rule { request.getRule() };
} else {
applicableRules = getApplicableRules(ftStyles, scaleDenominator);
}
So I see where the problem might be. It seems if you pass the SCALE argument
you'll get what your're looking for. Still, it seems wrong to me that if
SCALE is not being passed we generate a legend for all rules, instead of
calculating the scale denominator from the map size and request extent...
I would need to check the spec to see whether that should be the standard
behaviour or not.
Could you please open a jira issue and assign it to me so I don't forget and
you get notified of any progress?
Cheers,
Gabriel
Cheers
Andrea
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/java
one _______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
!DSPAM:4045,48089a8f116967180515871!