Bug report #179

Transparent WMS Layer aren't shown transparent.

Added by Redmine Admin over 18 years ago. Updated about 15 years ago.

Status:Closed
Priority:Low
Assignee:Gary Sherman
Category:Web Services clients/WMS
Affected QGIS version: Regression?:No
Operating System:RedHat Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10238

Description

I believe, that since my update from QT-4.1.2 to QT-4.1.3 former transparent shown WMS layer are shown opaque now. Perhaps is hasn't any relation to my QT update. For test you can try the following small swiss WMS service:

http://www.sogis1.so.ch/cgi-bin/sogis/sogis_uep.wms

Please regard it's a large scale layer and it should appear transparent.

History

#1 Updated by Gavin Macaulay - over 18 years ago

Browsing the Trolltech task tracker yields two bugs that may be causing this problem:

http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=116149

http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=119696

Both are scheduled to be fixed in the 4.2.0 version of Qt

#2 Updated by Brendan Morley - about 18 years ago

  • Status changed from Open to Closed
  • Resolution set to worksforme

I tried your http://www.sogis1.so.ch/cgi-bin/sogis/sogis_uep.wms WMS URL today;

It comes up with one layer (Übersichtsplan) which then appears to be completely blank. e.g. the Full layer extent at http://www.sogis1.so.ch/cgi-bin/sogis/sogis_uep.wms?SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&BBOX=7.340840,47.074200,8.033780,47.504100&SRS=EPSG:4326&WIDTH=578&HEIGHT=359&LAYERS=uep&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE

Transparent layers work in QGIS (e.g. qgis-0.8.0-win32-060724) so I'm going to close this ticket until such time that someone else can reproduce it.

#3 Updated by Redmine Admin about 18 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (worksforme)

With qgis-0-8.0-win32-060724 it works for me. But my RedHat QGIS does not work. If you like to see the spatial Data you have to set the following BBOX: 7.65519,47.17545,7.66674,47.18626

You will see the opaque effect when you add a second WMS layer with mentioned BBOX
Try http://www.sogis1.so.ch/cgi-bin/sogis/sogis_ch?
select the layer gemeinde_01 (Gemeindegrenzen Solothurn). The first layer of the TOC will cover the second layer.

My QT-version 4.1.3.

I hope this will explain much more better the mentioned behavior.

#4 Updated by Brendan Morley - about 18 years ago

I suppose the same opaque effect could be had for you when the background colour is set to non-white (through the Settings > Project Properties > General > Map Appearance settings) and you use the "http://www.sogis1.so.ch/cgi-bin/sogis/sogis_ch?" / "gemeinde_01" layer combination?

I have FC4 and Qt 4.1.0 and the above combo lets my non-white background show through (i.e. no bug). So I'm finding it difficult to reproduce. Perhaps we can put something in the release notes? Can you try with Qt4.1.0 at all?

#5 Updated by Redmine Admin about 18 years ago

No it is not possible to try it with QT4.1.0 due to some bugs of QT which will have influence to the stability of QGIS. I changed from QT4.1.2 where transparent WMS works to QT4.1.3 where transparent WMS doesn't work. The need of update QT to 4.1.3 was based on some Gnome gdm incompatibilities which leeds to QGIS crashes. Can you try it with QT4.1.3??

#6 Updated by Redmine Admin about 18 years ago

OK I changed from QT4.1.3 to QT4.1.0 and the transparency works without rebuild QGIS!! It looks like QT4.1.3 is the culprit.

When I connect to my WMS Layer the terminal throws tons of the following warnings:

Warning: Object::connect: No such signal QgsRasterLayer::drawingProgress(int,int)
Warning: QPaintEngine::setSystemRect, should not be changed while engine is active
Warning: QPaintEngine::setSystemClip(), should not be changed while engine is active

.... tons of these 2 lines ...

Warning: QPaintEngine::setSystemRect, should not be changed while engine is active
Warning: QPaintEngine::setSystemClip(), should not be changed while engine is active
Warning: Object::disconnect: No such signal QgsRasterLayer::drawingProgress(int,int)

Perhaps this can help you and me.

#7 Updated by Brendan Morley - about 18 years ago

Is it 4.1.0 that throws up all those warnings or 4.1.3?

I think the resolution to this is to add a release note to avoid 4.1.3 with transparent WMS layers. Your opinion?

#8 Updated by Redmine Admin about 18 years ago

Ups... Of course it's my mistake. 4.1.3 throws the messages.

Your suggested solution sounds like ESRI Support. Long time ago I had a problem with a non working ArcView3 feature. The ESRI Solution was to fix the documentation in regard to the error and not the faulty feature.

All jokes aside, but 4.1.4 doesn't work too.

#9 Updated by Gavin Macaulay - about 18 years ago

We're in a bit of a sticky situation here. Versions of Qt prior to 4.1.4 have other problems that have caused bugs in Qgis.

This particular problem is quite likely to be caused by one of the two bugs on Qt's tracker (see the first comment in this ticket). One of these has been flagged as fixed, and will be available in the next release of Qt. The other bug was put down to programmer error - perhaps we could look at how Qgis does things with the comments in that bug in mind.

#10 Updated by Redmine Admin about 18 years ago

I'm in doubt about the relation between the two QT bugs and our problem. 1. They were discovered at version 4.1.2, this version works fine for me. 2. The tickets do refer to PNG images. But GIF images are also shown opaque.

Unfortunately I'm not a great QT/C++ programmer, so I can't support you in this way.

I agree to your statement that versions of Qt prior to 4.1.4 have other problems that have caused bugs in Qgis.

It would be great when we are able to present transparent WMS layer at the FOSS4G2006 in Lausanne.

#11 Updated by Brendan Morley - about 18 years ago

Over the next few days I'll grab the latest Qt (4.1.4) and see if I can reproduce the error. This may be a low-priority activity for me though.

#12 Updated by Brendan Morley - about 18 years ago

I'm having issues getting 4.1.4 but in the meantime this may be another Qt bug that simulates this problem: http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=118082

#13 Updated by Brendan Morley - about 18 years ago

I finally was able to test this against Qt 4.1.3.

I am now also getting the following errors while retrieving the WMS layer:
---
Warning: QPaintEngine::setSystemRect, should not be changed while engine is active
Warning: QPaintEngine::setSystemClip(), should not be changed while engine is active
---
And the byte count is no longer updating.

HOWEVER, the http://www.sogis1.so.ch/cgi-bin/sogis/sogis_ch? server / gemeinde_01 layer / PNG encoding still gives a transparent background. I otherwise have a FC4 system.

I'm fast running out of ways of reproducing the problem, so I might leave this ticket dormant. I will have to raise another ticket to address the paint engine issue.

#14 Updated by Gavin Macaulay - about 18 years ago

Note that the QPaintEngine() warnings are due to an aspect of how qgis is trying to use the Qt4 canvas stuff. This problem has also been reported in ticket #139, albeit with different symptons.

#15 Updated by Brendan Morley - about 18 years ago

  • Status changed from Feedback to Open

I'm going to push this out from a 0.8 release as it doesn't appear to be a problem with QGIS and therefore shouldn't block its release. It's possibly not even a problem with Qt, perhaps being a problem with whatever libpng is being used to render the image.

I'm going to bow out of this one and let someone else have a go at it.

#16 Updated by Redmine Admin over 17 years ago

I cant' reproduce this with Kubuntu Feisty 7.04, QGIS 0.8.1p3 built against Qt 4.2.3. Is it still problem or could be closed now?

#17 Updated by horst-duester - over 17 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

The problem seems to be solved with QT4.2.x. I believe it can be closed now.

#18 Updated by Anonymous about 15 years ago

Milestone Version 0.9 deleted

Also available in: Atom PDF