Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5.0-RC.3 tested - problem with external WMS services #2606

Closed
guenterw opened this issue Nov 24, 2021 · 15 comments
Closed

3.5.0-RC.3 tested - problem with external WMS services #2606

guenterw opened this issue Nov 24, 2021 · 15 comments
Assignees
Labels

Comments

@guenterw
Copy link

Hi all,

Thank you for providing version 3.5.0-RC.3. I have tested it extensively and almost everything works as usual.
Positively I noticed the speed when creating the PDF files (print).

However, if there is a problem with a layer when printing, it does not (as before) give an error message (pointing out the faulty layer), but simply nothing happens.

But I have a problem with external WMS services.
These are only displayed if the setting "Get images directly from WMS server" is activated. But then these services are not printed.
(I had this problem also with version 3.4.x and QGIS-Server 3.16.x)

In Lizmap 3.3.x with QGIS server 2.18.28 I can print external WMS services if the setting "Get images directly from WMS server" is disabled.

This concerns general external WMS services, like e.g. [1] from BKG [2] but unfortunately also own WMS services, which I provide with Lizmap (3.4.x) and QGIS-Server (3.16.x). I like to split my projects on several servers, for load balancing when rendering.

Lizmap cannot display the WMTS service from BKG [3].
With the Tile Server service (XYZ Tiles) from OpenStreetMap [4], on the other hand, the display and also printing works!

The problem with the external WMS services has been bothering me for a long time and that's why I'm still using Lizmap 3.3.x with QGIS Server 2.18.28.
Am grateful for any hints. Gladly I can generate, or present examples.

Thanks in advance

Günter Wagner

[1] https://sgx.geodatenzentrum.de/wms_topplus_open
[2] https://gdz.bkg.bund.de/index.php/default/webdienste/topplus-produkte/wms-topplusopen-mit-layer-fur-normalausgabe-und-druck-wms-topplus-open.html
[3] https://sgx.geodatenzentrum.de/wmts_topplus_open/1.0.0/WMTSCapabilities.xml
[4] http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png

  • Lizmap version: 3.5.0-RC.3
  • QGIS Server FULL version: 3.16.13
  • QGIS Desktop FULL version: 3.16.13
  • OS (Windows, Linux, MacOS, Android…): Server: Ubuntu 20.04., Workstation: Windows 10Pro 64bit
  • Browser (Firefox, Chrome…): Firefox 94.0.2 (64-Bit), Chrome: 96.0.4664.45
  • Lizmap admin information (users, logs…) stored into Sqlite (default)? Sqlite
@nboisteault
Copy link
Member

Hi,
external WMS services are only known from browser, this is why there are not printed when Get images directly from WMS server is checked.

@guenterw
Copy link
Author

Thanks for the feedback.
Yes - I am aware of that. That's why I disable the "Get images directly from WMS server" option for printing.
But then, unfortunately, the WMS services are not displayed in the current version.

@guenterw
Copy link
Author

The RC.4 unfortunately also brings no improvement
Example project: https://dgm.herbolzheim.webgis.biz
Username: lizmap
PW: qgis-server

The Layers (WMS services) "TopPlusOpen Graustufen, see Info" [1] and "Test WMS Nutzungsartentexte, see Info" [2] are deposited with the deactivated option "Get images directly from WMS server".
[1] https://sgx.geodatenzentrum.de/wms_topplus_open
[2] https://wms62.webgis.biz/index.php/lizmap/service/?repository=30&project=herbolzheim_alkis_wms&VERSION=1.3.0&

@mdouchin
Copy link
Collaborator

@nboisteault we should check the LAYERS passed to the GetPrint and GetPrintAtlas methods do include the "external" layers. These layers are indeed in the QGIS projects, and can (and must) be printed

@cxcandid
Copy link

cxcandid commented Nov 29, 2021

@guenterw I did some testing and got some hints how you can solve your problem.

First of all, I would like to mention that it's perfectly possible to print external layers, as long as they are added to the QGIS project using the same name as the external layer. And it's not necessary to display this layer in the Lizmap layer tree. There is just one limitation by now: you can only substitute WMS and not WMTS layers using the Lizmap QGIS plugin. But you can add the externalAccess part directly in the project.cfg XML. In the example below, I added the XYZ layer "TopPlusOpen" in QGIS (https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/{z}/{y}/{x}.png), set it as baselayer in Lizmap and added the externalAccess part by hand.

        "TopPlusOpen": {
            "id": "TopPlusOpen_0a35bbef_2e46_4f21_960c_040981a1d8c2",
            "name": "TopPlusOpen",
            "type": "layer",
            "extent": [
                -20037508.342789244,
                -20037508.342789248,
                20037508.342789244,
                20037508.34278928
            ],
            "crs": "EPSG:3857",
            "title": "TopPlusOpen",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "False",
            "popup": "False",
            "popupFrame": null,
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "popupDisplayChildren": "False",
            "noLegendImage": "False",
            "groupAsLayer": "False",
            "baseLayer": "True",
            "displayInLegend": "False",
            "group_visibility": [],
            "singleTile": "False",
            "imageFormat": "image/png",
            "cached": "False",
            "serverFrame": null,
            "clientCacheExpiration": 300,
            "externalAccess": {
                "tiles": {
                    "zoomOffset": 6,
                    "maxResolution": 2445.9849047851562,
                    "numZoomLevels": 14,
                    "url": ["https://sgx.geodatenzentrum.de/wmts_topplus_open/tile/1.0.0/web/default/WEBMERCATOR/${z}/${y}/${x}.png"]
                }
            }
        }

Or you can add the corresponding WMS layer (https://sgx.geodatenzentrum.de/wms_topplus_open) to QGIS, set it as Lizmap baselayer and enable "Get images directly from WMS Server" in the Lizmap plugin. There was a problem with network timeouts, which I could solve setting "Timeout for network requests" to 100000 ms in QGIS Network options.

Because the BKG services are not very fast, I would recommend to use a proxy Server like MapProxy to cache the tiles locally. This really gives a big performance boost.

BTW, I'm using QGIS/QGIS Server 3.22.1-1 on Windows, together with Lizmap 3.5.0.

@guenterw
Copy link
Author

@cxcandid thank you for the detailed feedback and the tests.

I have now also tried again for half a day but unfortunately without any success.

The WMS services are displayed, even with the original name, only if they are fetched directly from the server. And then they are not printed.

The solution with the WMTS service and the addition in the cfg file did not work for me.

I also created a project with EPSG: 3857. I thought maybe it is because I am working in EPSG:25832. The project is online, but it doesn't bring anything new either.

How did you manage to print the external WMS services. Probably without the "Get images directly from WMS server" option after all . Here is the problem that then no map is displayed at all for me.

Only the XYZ service from OpenStreetMap works fine. Display and print, regardless of whether the option "Get images directly from WMS server" is enabled or not.

And as described, also on my server with QGIS 2.18.28 and Lizmap 3.3.x the printing works perfectly, if the services are not fetched directly from the server.

For me the question is, does it basically not work or is the problem with my configuration?

@cxcandid
Copy link

cxcandid commented Nov 30, 2021

@guenterw I found an issue with WMS using the debug window of the browser developer tools. I guess you need to rename your WMS layer in QGIS to the name of the WMS Service layer (i.e. "web") so that Lizmap can find it while printing. Please try my simple DEMO project: BKG_Test.zip and don't forget to set the QGIS network timeout to a high value (i.e. 100000) - Settings>Options...>Network>Timeout for network requests

Hope this will solve your problem!

@guenterw
Copy link
Author

@cxcandid thank you very much for your effort

I have set the network timeout. Unfortunately your example does not work either. Only the vector data is printed.
The project is online here:
https://dgm.herbolzheim.webgis.biz
Username: lizmap
PW: qgis-server

You use the option "Get images directly from WMS server" for the WMS service.
I always thought that this would not work, but I wonder why the WMS service is not displayed when this option is disabled.

Could it be my QGIS server installation? Is it possible that additional QGIS server plugins are needed?
I am currently using 3.16.13, will update to 3.16.14 tonight.

(I cannot load the WMS service osm-mapnik for the overview from your QGIS project into QGIS, but that is not important here)

@cxcandid
Copy link

cxcandid commented Nov 30, 2021

@guenterw I'm slowly running out of ideas, that's really a tough nut ;-)

Here are some more questions for you:

  1. do you use a proxy server for Internet connections?
  2. I'm sure you are using a dedicated user for Apache. Did you try to run the QGIS project under this user profile?

The osm-mapnik service was a mistake, now it should work fine: BKG_Test.zip

@guenterw
Copy link
Author

yes I am also in despair. I therefore continue to work with QGIS server 2.18.28 and Lizmap 3.3.x, Since everything runs fine.

The server is rented from Hetzner.com, as well as again the one with QGIS 2.18. Server. With standard Apache installation, only Ubuntu 20.04 instead of 18.04. Otherwise, everything (including the installation procedure) is almost identical.

Strange that the OSM XYZ service works fine.

Thanks for the tip with the map proxy. I wanted to test it for my cadastral data anyway. Maybe it can also provide XYZ services. I'll have to take a closer look at it.

Thanks in any case.

@cxcandid
Copy link

@guenterw last try, just to be sure that it is not related to the BKG service. Here's another example with a free basemap from Austria: Basemap_Test.zip

And if you like, so we don't bother others, we can continue via phone call in German ;-)

@guenterw
Copy link
Author

It is not the fault of the BKG services. It also affects others and own.

Summarizing again my problems compared to the older versions (QGIS server 2.18.28 and Lizmap 3.3.x):

  1. WMS services are not displayed without option "Get images directly from WMS server" and therefore not printed.
  2. in case of errors in the printing process there is no error message as before but nothing happens.

@cxcandid We can talk on the phone, I am always happy to get in contact with other Lizmap users. Contact details see https://wagner-it.de

@mdouchin
Copy link
Collaborator

@guenterw You should try without Lizmap, by requesting directly QGIS Server. It really seems QGIS cannot access the WMS server in your case.

When activating the option Get images directly from WMS server, the Lizmap map in the browser does not ask QGIS Server for the image (so QGIS Server does not need to request the data from the WMS server) but directly requests the image from the external server.

@guenterw
Copy link
Author

@mdouchin Thanks for the hint but my knowledge (and time) is not enough for that.

I get the GetCapabilities incl. the layer information and from the layers also the caption of the legend but not more (but also not from the vector layer). I don't want to share the results here because of the IP address.

Thus I remain with my productive systems, in which I must print WMS services, for the time being with the old versions. There everything works fine.

@guenterw
Copy link
Author

guenterw commented Dec 1, 2021

according to further feedback from Lizmap users, displaying and printing WMS services without the "Get images directly from WMS server" option works fine in the current versions (3.16.x with 3.4.x).
This must be a strange bug only with me. I have to look for it further or I will install a new server over Christmas.

Many thanks, especially to the development team of Lizmap for the continuous development of this great WebClient.

@guenterw guenterw closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants