Bug report #20810

QGIS Server 3 - drawing order of grouped layer

Added by Burghardt Scholle over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:QGIS Server
Affected QGIS version:3.4.2 Regression?:Yes
Operating System:Xubuntu 18.04, Windows 7 64bit Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:28629

Description

I noticed problems with the drawing order of grouped layers on QGIS Server 3. If I load a WMS service consisting of several (grouped) layers completely into a desktop GIS, everything is fine. However, if I load several single layers from this WMS service, area and line layers of a grouped layer are drawn first and "painted over" by other layers (e.g. raster data, see attached screenshots). That's not the expected behavior and with QGIS Server 2 this problem doesn't exist.
I add a QGIS project file and a geopackage with sample data (see attached zip-file qs3.zip).

qs3.zip - QGIS project file, gpkg (45.6 KB) Burghardt Scholle, 2018-12-14 07:21 AM

QS3_actual.png - screenshot 2 (163 KB) Burghardt Scholle, 2018-12-14 07:21 AM

QS3_expected.png - screenshot 1 (197 KB) Burghardt Scholle, 2018-12-14 07:21 AM

QS3_Layers_1.png (10.8 KB) Burghardt Scholle, 2019-01-04 12:13 PM

QS3_Layers_2.png (10.5 KB) Burghardt Scholle, 2019-01-04 12:13 PM

Associated revisions

Revision 1ba6b97f
Added by Alessandro Pasotti over 5 years ago

[server] Fix layer order rendering when layers are in groups (#8796)

  • [server] Fix layer order rendering when layers are in groups

Fixes #20810

  • Update test images
  • [server] Fix order of layers in subgroups

basically: layers in WMS is specified in a comma separated
list where leftmost layer is drawn first (it's at the bottom)
and QGIS layer order is exactly the opposite: first layer
in the TOP (topmost) is drawn last (it is at the top).

For this reason the server reverses the list before passing
it to the renderer.

  • Fix order of layers in test
  • Update src/server/services/wms/qgswmsrenderer.cpp

History

#1 Updated by Alessandro Pasotti over 5 years ago

  • Priority changed from Normal to High
  • Regression? changed from No to Yes

#2 Updated by Alessandro Pasotti over 5 years ago

  • Assignee set to Alessandro Pasotti

#3 Updated by Alessandro Pasotti over 5 years ago

  • Status changed from Open to Feedback

I don't see any issue with drawing order with current QGIS master, can you please add the exact WMS calls that are causing the problem?

For example:

/?MAP=/Maps/bug_20810/qs3/qserver_GroupedLayer.qgs&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=616348.1189196829218,5810956.442350113764,617354.0284219451714,5812345.854850113392&CRS=EPSG:25832&WIDTH=640&HEIGHT=884&LAYERS=as_areas,OpenStreetMap%20(grayscales)&STYLES=default,default&FORMAT=image/jpeg&DPI=192&MAP_RESOLUTION=192&FORMAT_OPTIONS=dpi:192

#4 Updated by Burghardt Scholle over 5 years ago

Hi Alessandro,
thank you so much for taking care of this problem.

I have done tests with the current QGIS Master (for me: code revision d59a346560). The problem still persists. Unfortunately, I can't serve on the fast with an accurate WMS call :-(. Alternatively, I have made two screenshots of possible settings when adding layers using the "Data Source Manager" in QGIS Desktop. I hope that's sufficient.

#5 Updated by Alessandro Pasotti over 5 years ago

  • Status changed from Feedback to In Progress

I've found the issue, working on a fix...

#6 Updated by Alessandro Pasotti over 5 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

#7 Updated by Burghardt Scholle over 5 years ago

Thank you for taking care of the problem and solving it. As soon as I have a newer qgis dev version, I will test it again and report afterwards. Currently I only have the QGIS code version 48db864, which does not contain your changes yet.

#8 Updated by Burghardt Scholle over 5 years ago

Good work: I did tests with QGIS master 13ac907 today and can confirm the fix. Thanks a lot!

#9 Updated by Giovanni Manghi over 5 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF