Bug report #16769

QGis server GetPrint request renders layer in wrong order, polygons are on top

Added by lars Lingner almost 3 years ago. Updated over 2 years ago.

Status:Closed
Priority:High
Assignee:René-Luc ReLuc
Category:QGIS Server
Affected QGIS version:2.18.11 Regression?:Yes
Operating System:Linux Mint 18.1 Serena / Ubuntu 16.04 Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24668

Description

Hello,

I've setup a QGis Server 2.18.10 (wasn't available in Affected QGis Version on the submit form). Requesting via GetPrint and groupname or map name the layer order isn't right, maybe reversed.
Export directly in QGis desktop and via WMS request is working properly.

I compared the QGis logfile for a request with group name and all layer names and it is the same. The layer names are in the right order, if the order in the log is actually showing render order.

The getProjectSettings request is listing the layers also in the right order.

At the supplied archive you will find my test case, which includes
- point,line,multiline,polygon layer
- OSM source data
- GetProjectSettings.xml

Layer structure is:
Group: grundkarte
Layers: points,lines,multilines,polygons

I'm happy to help and test. Right now I don't know how, because the logfiles don't give me a clue.

bugreport_qgisserver.tar.gz (1.74 MB) lars Lingner, 2017-06-29 06:09 PM

History

#1 Updated by Giovanni Manghi almost 3 years ago

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

#2 Updated by René-Luc ReLuc almost 3 years ago

Does your GetPrint request is build by QWC or Lizmap ?
In QGIS 2.18 compare to 2.14 the layer order has been changed in GetPrint request.

#3 Updated by Giovanni Manghi almost 3 years ago

  • Status changed from Open to Feedback

#4 Updated by lars Lingner almost 3 years ago

René-Luc ReLuc wrote:

Does your GetPrint request is build by QWC or Lizmap ?

Actually, I wrote it by myself.

qgis_mapserv.fcgi?VERSION=1.3.0&MAP=/path/to/qgis-project.qgs&styles=&format=pdf&request=GetPrint&layers=grundkarte&SRS=EPSG%3A3857&transparent=true&service=WMS&map0:extent=790262,6573581,792161,6575585&DPI=300&TEMPLATE=xxx

This request, using only the group name, is rendering the layer in wrong order.

qgis_mapserv.fcgi?VERSION=1.3.0&MAP=/path/to/qgis-project.qgs&styles=&format=pdf&request=GetPrint&layers=polygons,multilines,lines,points&SRS=EPSG%3A3857&transparent=true&service=WMS&map0:extent=790262,6573581,792161,6575585&DPI=300&TEMPLATE=xxx

This request, using explicit layer names, is working fine.
If I reverse the layer names, the rendering is also reversed. IMHO everything ok. First layer is rendered first, following layers rendered on top of it.

In QGIS 2.18 compare to 2.14 the layer order has been changed in GetPrint request.

Right, but it would only affect requests without group names?

Update: I'm using now 2.18.11

#5 Updated by Michael Douchin almost 3 years ago

I confirm this behaviour, with QGIS Server 2.18.11. When calling a GetPrint request with a group name (containing several groups or layers), the rendering of each layers of this group is reversed. For example, if you have

MyGroup
- polygon cities with only borders (no fill)
- contours lines
- dem raster

You see only the dem raster when you use Mygroup in the layers parameter of the getprint request

#6 Updated by Giovanni Manghi almost 3 years ago

  • Status changed from Feedback to Open
  • Affected QGIS version changed from 2.18.9 to 2.18.11

#7 Updated by René-Luc ReLuc over 2 years ago

  • Assignee set to René-Luc ReLuc
  • Pull Request or Patch supplied changed from No to Yes

PR submitted https://github.com/qgis/QGIS/pull/5168

Can you test it ?

#8 Updated by Michael Douchin over 2 years ago

Just tested it : it works now like a charm.
Thanks

#9 Updated by René-Luc ReLuc over 2 years ago

  • Resolution set to fixed/implemented

#10 Updated by Giovanni Manghi over 2 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF