[Qgis-developer] [Qgis-user] WMS Rendering Problems

Tom Elwertowski telwertowski at comcast.net
Tue Oct 30 14:49:30 EDT 2007

Micha Silver wrote:
> In some early work I noticed on windows, displaying maps from a WMS 
> server (mapserver 4.10.2) that the map image doesn't appear until I "do 
> something". I have to open some other dialog box, then when I close it, 
> the map appears. If I pan or zoom, I see the map layers *while panning*, 
> but as soon I  release the mouse the map layers (as well as north arrow 
> and other decorations) disappear. If I click on the "Render" button to 
> disable rendering, then click again to re-enable, the map appears. But 
> again, any zooming or panning causes it to disappear. I've tried palying 
> with the Rendering options "Update display after reading 1 feature", but 
> that didn't change anything.

This looks like a bug which was reported for Mac OS X a while ago. I 
have a patch which is essentially complete but I don't have the 
capability to build QGIS for Windows. If you or someone else can do a 
source build, I would be interested in finding out if the patch fixes 
your problem.

The patch currently has two deficiencies which probably don't affect you:
1.) errors are not reported until one or two refreshes later.
2.) the indirection code for layers which return urls instead of bitmaps 
has not been tested.

The refresh problem arises from the fact that the WMS layer is not 
requested until after the redraw cycle begins. Om a Mac (and probbably 
Windows too, based upon your observations), drawing cannot be 
interrupted to do something else -- either you already possess the 
bitmap or you don't start drawing. The reason you don't see the image 
until some future action is that the WMS image don't show up until after 
the refresh cycle that requested it has competed.

> On an Ubuntu machine with the debian binary (Thanks to Jachym Cepicky!), 
> pulling layers from the same WMS server, I don't see this behavior at all.

The reason it works using Ubuntu is that X11 was designed as a 
client/server display system. Since the display doesn't need to be on 
the same machine as the application, X11 is most likely not confounded 
by network requests inside draw events.

The fix I made is to remove the synchronous network request inside the 
draw event with async requests which must be completed before starting 
to draw. This also speeds things up for multiple WMS layers since all 
layers are requested in parallel rather than serially.

> BTW, displaying layers using the WFS plugin from the same server works 
> well on both systems.

The WFS plugin doesn't make network requests inside draw events so the 
problem doesn't happen for WFS.

One further request from readers: does anyone know of a WMS server that 
returns an indirect pointer rather then a bitmap? The main reason I 
haven't submitted this patch previously is that I haven't been able to 
test that situation. Alternatively, I could add a message "Indirect 
retrieval temporarily disabled: send a url if you would like this 
feature back."


More information about the Qgis-developer mailing list