qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.38k stars 2.98k forks source link

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

Closed qgib closed 7 years ago

qgib commented 7 years ago

Author Name: lars Lingner (@gislars) Original Redmine Issue: 16769 Affected QGIS version: 2.18.11 Redmine category:qgis_server Assignee: René-Luc ReLuc


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

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.


qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 7 years ago

Author Name: René-Luc ReLuc (@rldhont)


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.

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 7 years ago

Author Name: lars Lingner (@gislars)


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

qgib commented 7 years ago

Author Name: Michael Douchin (@mdouchin)


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

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

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 7 years ago

Author Name: René-Luc ReLuc (@rldhont)


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

Can you test it ?


qgib commented 7 years ago

Author Name: Michael Douchin (@mdouchin)


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

qgib commented 7 years ago

Author Name: René-Luc ReLuc (@rldhont)


qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)