Ok, at first the problem seemed the dot in the layernames:
This is the GetMap request QGIS fires off:
as you see: LAYERS=rt_ofc.10k54
This is the GetLegendGraphic url created by QGIS:
(all seen in the debug info on QGIS on Linux (Debug)):
Which SHOULD be:
NOTE, I edited: layer=rt_ofc.10k54
Mmm, not much of an legend, but as least NOT an image of all (vector)
So crux is: IF a layer parameter has a dot in it's name, only the first
part is used as parameter....
BUT: what is the GetLegendGraphic url advertised by the server:
Mmm, actually no style/LegendURL advertised :-(
points to pickLegend:
which looks ok:
BUT apparently it picks the style of the PARENT-NODE of the layer: THAT
Bingo: that is the one we are actually retrieving, the parent node's
style and legend.
So: not sure if that is desired behaviour... at least not for a legend..
I think what QGIS does is 'inheriting' default styles from parent nodes.
In this case that is plain wrong.
Copy/paste this in an QGIS issue?
Maybe for the getLegend url, the style should not be inherited?
Anybody other ideas?
On 03-09-16 16:08, Andrea Peri wrote:
> Hi Richard.
> Effectivelly I tested your wms and using it the legend is correctly
> retrieved only for the layer choose.
> I use qgis 2.16.1.
> After I re-test my original url:
> And again I see the qgis retrieve ALL the legend of all the layers.
> I tested other wms of our set of wms service and seem only this has
> that problem.
> So I do some more proof tested.
> And found where is the ISSUE.
> QGIS wrong to get the legend when the layer wms requested HAS NOT A LEGEND.
> Infact the issu happened when I ask any layer of our wms that is a
> RASTER LAYER with no legend defined.
> Instead not happened when the layer wms is of a vector dataset (where
> the legend happened).
> SO If you whould test and see the issue you should use our wms service:
> and choose the layer
> that return the orthophoto imagery of the year 1954.
> With this layer the qgis will retrieve ALL the legends of the wms service.
> Instead if you choose the layer
> that is a vector dataset (quadre of union)
> qgis correctly retrieve only its own legend.
> Please can you confirm this ?
> 2016-09-03 9:51 GMT+02:00 Richard Duivenvoorde <rdmaili...@duif.net>:
>> On 31-08-16 21:10, Andrea Peri wrote:
>>> I notive that in the qgis 2.14.5 and in the qgis 2.16.1
>>> when adding a layer wms choosing from a list of layers available in
>>> the wms service connected,
>>> qgis retrieve as legend of the layer ALL the legends of all the wms
>>> layer available in the wms service.
>>> Using the 2.8 QGIS version, the legend is retrieve correctly (only the
>>> layer choosed).
>>> Someone can confirm this as an issue ?
>> Hi Andrea,
>> nope, I have 2.16.1 here, and for example this wms:
>> I can choose either provincies or landsgrenzen (provinces or country
>> borders), from that same server and both have their own legend.
>> Do you have a WMS url for which this happens for you?
>> What if you look at the capabilities of that service and do the
>> getLegendGrapicRequest by hand. Is it also wrong?
>> Else: create a good issue, with url's screendumps etc etc
>> Richard Duivenvoorde
Qgis-user mailing list
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user