Bug report #12610
QGIS not showing WMS legend while LegendURL is present
|Category:||Web Services clients/WMS|
|Affected QGIS version:||2.8.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||20729|
I'am reporting on issue my customer, the Flemish government has reported.
In all of our wms-services, we define a WMS-legend url inside the /WMS_Capabilities/Capability/Layer/Style/LegendURL tag.
But these aren't shown in the table of contents in QGIS.
For example the wms:
For the layer BWK1Zone the legend url is defined as:
--> works fine in openlayers and other gis-applications, but not in QGIS.
For wms-services of the Brussels Government these Legends are shown:
For the layer bruenvi_natura_2000_buffer the legend url is defined as:
--> works in openlayers and QGIS.
Is this a Bug in QGIS?
The original question to me in dutch is added as a attachment.
#1 Updated by Filip Mahieu about 5 years ago
- File LegendError.png added
We do have a similar error here. When loading the WMS url=http://wms.agiv.be/ogc/wms/omkl&layers=Ortho&format=image/png&styles=default&crs=EPSG:31370 by means of that discribed plugin, we get the error 'Returned legend image is flawed', see attachment.
When then using this layer in a composer, Qgis blocks. So this really an issue i think!
Thanks for looking at this!
#2 Updated by Filip Mahieu about 5 years ago
- File LegendError2Composer.png added
More specific: QGis blocks when effectively adding the legend in the composer. You see in attachment what you get after adding the legend in the composer. you don't get a legend at all, it's rather blank, but there is space.
Then you can't do anything anymore but closing the composer and then Qgis.
#7 Updated by Filip Mahieu almost 5 years ago
Nyall Dawson wrote:
This issue seems to consist of two separate issues. The second (composer hang) is fixed in 2.10 and will be in 2.8.3, not sure if the first is fixed (not showing legend).
Indeed, the 'composer hang' is fixed in 2.8.3. But there's still no legend.
#8 Updated by Henrik Uggla over 4 years ago
If I give a layer a (external) legendURL and do GetCapabilities I get:
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://www.osgeo.org/sites/all/themes/osgeo/logo.png"/>
Which is correct. But when I do GetLegendGraphic I get a simple marker instead. Is this the same bug or should I open a new one (for Qgis Server)?
Qgis Server 2.8.2 on Ubuntu 14.4
Nevermind, I've opened a new bug: 13595
#10 Updated by Patrick Valsecchi over 4 years ago
I'm not sure QGIS is doing anything wrong, there. The URL given for BWK1Zone is clearly wrong. It has only one parameter named request and it has this value: GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=BWK1Zone
If you look at the URL given for layer bruenvi_natura_2000_buffer, it has 7 parameters and they are all good.
This is due of the wrongfull replacement of the "&" by "%26" in the URLs in the first case.
#13 Updated by Stefan Blumentrath almost 4 years ago
While it should show e.g. this:
The server behind the WMS is Mapserver 7.0.1.