Opened 14 years ago

Closed 13 years ago

#3411 closed enhancement (fixed)

WMS GetLegendGraphic should support group parameter

Reported by: assefa Owned by: assefa
Priority: normal Milestone: 6.0 release
Component: WMS Server Version: unspecified
Severity: normal Keywords: getlegendgraphic group support
Cc: stephan.holl@…, bartvde, tomkralidis

Description

WMS GetLegendGraphic should support group parameter

Attachments (1)

bug3411_ms5.6.patch (3.3 KB ) - added by assefa 14 years ago.
patch for thr 5.6.x branch

Download all attachments as: .zip

Change History (24)

comment:1 by sholl, 14 years ago

Cc: stephan.holl@… added

comment:2 by sholl, 14 years ago

Assefa,

is there any new progress in this ticket 1952? I am interested in this feature, because I heavily use GROUPs and the hidden_layer-patch from Issue and the related patch http://trac.osgeo.org/mapserver/attachment/ticket/1952/ms540b1-hidden-layers.patch?format=raw and some information from http://trac.osgeo.org/mapserver/wiki/HidingLayersInOGCWebServices

TIA

Stephan

comment:3 by assefa, 14 years ago

Stephan,

I have not had any chance to work on this. My intention is to spend some time on OGC development/issues just before the release of the 6.0 at the end of this summer. Hopefully this issue will be addressed then.

comment:4 by sholl, 14 years ago

Assefa,

thanks for the info, I would be happy to have it in one of the 5.x-branches thought. Let me know if I can provide any help in getting this issue done faster.

in reply to:  3 comment:5 by sholl, 14 years ago

Replying to assefa:

Stephan,

I have not had any chance to work on this. My intention is to spend some time on OGC development/issues just before the release of the 6.0 at the end of this summer. Hopefully this issue will be addressed then.

Assefa,

did you had a chance to look deeper in this issue? (At least here in Germany) the summer is almost gone now. I have a client which could bring in some funding in make this issue happen more early. Is there an RFC needed or will this be a quite short patch? Eventually we could sponsor a dev to hack this too.

It would be nice to outline your implement plans for this enhencement.

Thanks for your comments.

Stephan

comment:6 by assefa, 14 years ago

Stephan,

Summer is also gone here in Ottawa :) It does not need an RFC. I will detail what needs to be done in the next week and we will go from there. It will be for 6.0 but I don't for-see any problem having a 5.6.x patch.

best regards,

in reply to:  6 comment:7 by sholl, 14 years ago

Replying to assefa:

Stephan,

Summer is also gone here in Ottawa :) It does not need an RFC. I will detail what needs to be done in the next week and we will go from there. It will be for 6.0 but I don't for-see any problem having a 5.6.x patch.

best regards,

Assefa,

excelent news. If you need an active tester of this scenario, let me know! I am interested in a 5.6.x patch as well.

TIA

Stephan

comment:8 by assefa, 14 years ago

Has a quick look ... Just to understand whet you need: The GetLegendGraphic has an interface that draws the legend for only *one* layer. Right now that parameter is compared to the layer's name to turn that layer on. You want the comparing to be extended to the layer's group parameter set in the map file, right? Only the first layer that fits the criteria is selected. Please confirm.

in reply to:  8 comment:9 by sholl, 14 years ago

Replying to assefa:

Has a quick look ... Just to understand whet you need: The GetLegendGraphic has an interface that draws the legend for only *one* layer. Right now that parameter is compared to the layer's name to turn that layer on. You want the comparing to be extended to the layer's group parameter set in the map file, right? Only the first layer that fits the criteria is selected. Please confirm.

Mhh, I am afraid I ment that _all_ layers included in the given group-name will be drawn as one legend graphic. The idea behind that is the the grouping make several layers appear as _one_ layer, so the resulting legend should include _all_ relevant class-entries of _all_ layers with the given group-name.

Is this more clear to you now? Anyway, thanks for looking into this.

comment:10 by assefa, 14 years ago

Cc: bartvde tomkralidis added

This has to be more defined before being implemented: my understanding is that GetLegenndGraphic interface assumes that only one layer will be used. Style and rule parameter seem to be for one layer, would they apply for more for than one layer? Should they be ignored or give an exception in case we have several layers? What we want here is basically a mapserver get legend on some layers; maybe it make sense to have another WMS interface rather that using GetLegendGraphic. I have cc's others to hear comments. I checked Geoserver doc to see but could not immediately determine if multiple layers were supported.

in reply to:  10 comment:11 by sholl, 14 years ago

Replying to assefa:

This has to be more defined before being implemented: my understanding is that GetLegenndGraphic interface assumes that only one layer will be used. Style and rule parameter seem to be for one layer, would they apply for more for than one layer? Should they be ignored or give an exception in case we have several layers? What we want here is basically a mapserver get legend on some layers; maybe it make sense to have another WMS interface rather that using GetLegendGraphic. I have cc's others to hear comments. I checked Geoserver doc to see but could not immediately determine if multiple layers were supported.

Sure, let me bring in an example what my thinking is. Water |_ lakes |_ rivers |_ more waterareas

So the group water groups 3 more layers. What is your thinking about the result of GetLegendgraphic from the layer Water?

I think the Water-Legend should include the legend-graphics from lakes,rivers and more waterareas.

Makes sense? I am looking forward for the other comments.

comment:12 by assefa, 14 years ago

The need make sense to me. I just need to have feed backs on how to deal with style and rule parameters if given: should we just ignore them if there are multiple layers, should we throw exceptions? The implementation should be strait forward once we define how we want it to work.

comment:13 by bartvde, 14 years ago

@assefa I think it depends on the way Mapserver advertizes group layers in the WMS GetCapabilities. If a named style is given in the GetCapabilities for the group layer, it should be possible to use it in a GetLegendGraphic request. Does Mapserver support GetStyles for group layers currently? If not, then clients cannot know of the Rules available and Rule should just be ignored IMHO. The best option ofcourse would be to support GetStyles for group layers as well and implement the Rule parameter in GetLegendGraphic.

comment:14 by assefa, 14 years ago

A named style is only available at the layer level and not at the group level. GetStyles is also based on the layer's name and not the group name. Implementing rules/styles at the group means exposing things common? I see this as being possible/make sense for styles but not so much for rules. For now I will ignore rules and styles in case we have multiple layers (due to group selection). The result will be a MapServer legend that includes all layers selected.

in reply to:  14 comment:15 by sholl, 14 years ago

Replying to assefa:

A named style is only available at the layer level and not at the group level. GetStyles is also based on the layer's name and not the group name. Implementing rules/styles at the group means exposing things common? I see this as being possible/make sense for styles but not so much for rules. For now I will ignore rules and styles in case we have multiple layers (due to group selection). The result will be a MapServer legend that includes all layers selected.

Sounds great. This means that group-names ignore style and rule-parameters then? Is there any (technical) issue to also accept styles withing GLG?

in reply to:  14 comment:16 by bartvde, 14 years ago

Replying to assefa:

A named style is only available at the layer level and not at the group level. GetStyles is also based on the layer's name and not the group name. Implementing rules/styles at the group means exposing things common? I see this as being possible/make sense for styles but not so much for rules. For now I will ignore rules and styles in case we have multiple layers (due to group selection). The result will be a MapServer legend that includes all layers selected.

Regarding GetStyles: you could just output all sublayers in the same SLD document, so not just the common things.

by assefa, 14 years ago

Attachment: bug3411_ms5.6.patch added

patch for thr 5.6.x branch

comment:17 by assefa, 14 years ago

committed in trunk r10630

patch attached for the 5.6 branch.

in reply to:  17 comment:18 by sholl, 14 years ago

Replying to assefa:

committed in trunk r10630

patch attached for the 5.6 branch.

Assefa,

great stuff! This works like a charme, tested with the provided patch against the 5.6.5-release. Good to know this is working now. Here is a small doc-patch to reference this feature as well. let me know if you need more documentation about that.

Index: wms_server.txt
===================================================================
--- wms_server.txt      (Revision 10638)
+++ wms_server.txt      (Arbeitskopie)
@@ -516,7 +516,9 @@
 ------------------------

 This request returns a legend image (icon) for the specified layer. The request
-will draw an icon and a label for all classes defined on the layer.
+will draw an icon and a label for all classes defined on the layer. If
+the requested layername is a GROUP-name, all included layers will be
+returned in the legend-icon.

 Requirements
 ************


in reply to:  17 comment:19 by sholl, 14 years ago

Replying to assefa:

committed in trunk r10630

patch attached for the 5.6 branch.

Assefa,

shouldn`t the GetCapabilities-Doc represent the given GroupLayer a LegendURL-Block as well? Currently the server answers the requests, but does not promote it in its capabilities.

What does others think?

Thank you

Stephan

comment:20 by assefa, 13 years ago

This makes sense. We could simply generate a style tag with a legend url (style being set to default). Looking more closely in this ...

comment:21 by assefa, 13 years ago

committed in trunk r10857 note about it updated in r10858

comment:22 by assefa, 13 years ago

closing.

comment:23 by assefa, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.