Bug report #16180

WMS browser panel loads wrong layer

Added by Tobias Wendorff about 7 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Web Services clients/WMS
Affected QGIS version:2.18.3 Regression?:No
Operating System:Microsoft Windows 7, 64-bit Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:24090

Description

The WMS menu in Browser Panel seems to load the wrong/not enough layers.
I've tried to load this WMS, but didn't get any results: http://www.wms.nrw.de/umwelt/laerm

After investigating the problem with a HTTP-proxy, I figured out that the wrong layer was grabbed (actually, only a GetCapabilities was requested).
I've gave the menu's "Add WMS/WMTS-layer" a try. In there, I've selected the right sub-layer and got the expected result.

You can see the problem in the animation gif attached to this post.

wms_bug_01.gif - GIF animation (666 KB) Tobias Wendorff, 2017-02-11 12:46 PM

History

#1 Updated by Richard Duivenvoorde about 7 years ago

Hi,

I tried to reproduce your issue, but to be honest I'm even not able to see the image you get in your animated gif.

Can you please describe in words the layers/crs/imageformat etc you try to use (both layer and project?)

The WMS always first reads the capabilties of the WMS and with that get's information about layers etc etc.

So this looks ok, isn't it:

http://www.wms.nrw.de/umwelt/laerm?request=GetCapabilities

and if you run QGIS in debug mode, you see that QGIS tries to retrieve an WMS image with this url:

https://www.wms.nrw.de/umwelt/laerm?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=50.15059999999999718,5.724990000000000023,52.60199999999999676,9.531539999999999679&CRS=EPSG:4326&WIDTH=1002&HEIGHT=647&LAYERS=STR_DEN&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE

which is a transparent image. Whatever I try, I never get your map. Did you try other wms clients?

One thing which is not normal is that in the datasource of the properties of a layer of your wms is that I see something like:

contextualWMSLegend=0&crs=EPSG:4326&dpiMode=7&featureCount=10&format=image/png;%20mode%3D24bit&layers=STR_DEN&styles=default&url=http://www.wms.nrw.de/umwelt/laerm

while normally you see something like:

crs=EPSG:28992&layers=cbsgebiedsindelingen:cbs_provincie_2007_gegeneraliseerd&styles=cbsgebiedsindelingen:cbs_gebiedsindeling&format=image/png&url=http://geodata.nationaalgeoregister.nl/cbsgebiedsindelingen/ows?SERVICE%3DWMS%26

Maybe that rings a bell with someone?

So can you please describe what I can do to reproduce your issue?

#2 Updated by Richard Duivenvoorde about 7 years ago

Ah... NOW I get an image:

https://www.wms.nrw.de/umwelt/laerm?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=51.42312825621159789,7.201033122179148371,51.54250891635459908,7.444299601640792297&CRS=EPSG:4326&WIDTH=1506&HEIGHT=739&LAYERS=STR_DEN&STYLES=default&FORMAT=image/png;

by guessing from the capibilities that the data is in Dortmund I zoomed in and THEN something appears...

So in my view this is not a QGIS issue, but a misconfigured WMS-server:
- your layers are scale dependent: you only see data when you zoom in enough
- your WMS defines a very LARGE bbox as default bbox

which makes QGIS zoom to this BBOX first at a zoom level you do not see anything.

So best is to define a better bbox in the capabilities of your WMS

Does this sound reasonable?

#3 Updated by Tobias Wendorff about 7 years ago

I thought an animated GIF would make it easier to understand for all languages, but okay - let's try it in English :)

1. The project CRS can either be set to EPSG:4326 or EPSG:25832 (native SRS) to reproduce the bug.
2. I've set up a bookmark with this BBOX (Düsseldorf in Germany): 6.83 51.21 6.85 51.23 (for the German testers: 6,83 51,21 6,85 51,23)
3. I'll test it with layer 10 (sublayer 11 with style=default), which is about noise coming from trains all over the day.
3. a) When loading the WMS using the "Browser Panel", I'm getting an empty map image, but the WMS legend gets loaded.
3. b) When loading the WMS using the "Add WMS layer" from the menu or "Manage Layers toolbar", it works for me as expected.

#4 Updated by Richard Duivenvoorde about 7 years ago

A legend is always loaded as QGIS just loads the GetLegendGraphics request.
The layers are scale dependent, so QGIS requests a layer but the server returns a transparent image

I think this is not a bug, and this issue can be closed

#5 Updated by Tobias Wendorff about 7 years ago

Richard Duivenvoorde wrote:

A legend is always loaded as QGIS just loads the GetLegendGraphics request.
The layers are scale dependent, so QGIS requests a layer but the server returns a transparent image

The layers are scale dependent, but I'm testing both variants at exactly the same scale! Did you even watch the animation? You can clearly see that I'm zooming to the same bookmark.

EDIT: I've figured out the real problem by using a proxy server!

When using Add WMS layer or Manage Layers toolbar, this gets requested:

https://www.wms.nrw.de/umwelt/laerm?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=51.20864726308272452,6.818027744091569531,51.23134997181813333,6.861941099535693311&CRS=EPSG:4326&WIDTH=1290&HEIGHT=667&LAYERS=SCB_DEN&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE

When using Browser Panel this gets requested from WMS:

https://www.wms.nrw.de/umwelt/laerm?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=2719705.686675078236,3785531.978490603156,2721794.643601302989,3788219.639582599513&CRS=EPSG:3034&WIDTH=826&HEIGHT=642&LAYERS=SCB_DEN&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE

That's another CRS without any content. Seems like Browser Panel grabs the first CRS it can find, since EPSG:3034 is the first one listed in GetCapabilites.

#6 Updated by Giovanni Manghi about 7 years ago

  • Status changed from Open to Feedback

Tobias Wendorff wrote:

Richard Duivenvoorde wrote:

A legend is always loaded as QGIS just loads the GetLegendGraphics request.
The layers are scale dependent, so QGIS requests a layer but the server returns a transparent image

The layers are scale dependent, but I'm testing both variants at exactly the same scale! Did you even watch the animation? You can clearly see that I'm zooming to the same bookmark.

EDIT: I've figured out the real problem by using a proxy server!

When using Add WMS layer or Manage Layers toolbar, this gets requested:
[...]

When using Browser Panel this gets requested from WMS:
[...]

That's another CRS without any content. Seems like Browser Panel grabs the first CRS it can find, since EPSG:3034 is the first one listed in GetCapabilites.

I just tested on both Linux and Windows using 2.18.4 and the request created by adding the layer from the "add WMS..." dialog OR the browser is exactly the same, and in fact I see both layers as expected.

Could you try on 2.18.4 and/or o a clean environment (no 3rd party plugins, purged .qgis2 folder, purged network cache, etc.)

thanks.

#7 Updated by Tobias Wendorff about 7 years ago

  • Status changed from Feedback to Closed

Sorry, took some time.

I tried it on a Windows computer, which has never seen QGIS before. I've installed 2.18.4 coming from standalone-installer.
When adding the WMS-layer via "Browser Panel", it's fixed to EPSG:3034 - the first one in the list. There's no way to change it. When adding the WMS-layer via "Add Layer(s) from a WMS Server", I can select EPSG:4326 and I'm getting data.

So the problem is:
When using "Browser Panel", a CRS is selected, where the (misconfigured) server never seems to deliver any data. Since it's impossible to change the projection when using "Browser Panel" it doesn't seem to be a bug of QGIS, just a missing important feature.

Closed.

Also available in: Atom PDF