3liz / py-qgis-server

QGIS embbeded WMS/WFS/WCS asynchronous scalable http server
https://docs.3liz.org/py-qgis-server
Mozilla Public License 2.0
67 stars 16 forks source link

functions didn't render correctly in GetFeatureInfo #45

Closed lassitanskanen closed 1 year ago

lassitanskanen commented 2 years ago

Hi,

I can't get working functions with GetFeatureInfo requests. There is also custom function in qgis profile folder.

Response didn't render correctly: <Attribute name="maptip" value="<h3>Niittypolku 1 [% if("varauslomake"='x',generateFormUrl( "alue","korttelin_nro","tontin_nro","tontin_tyyppi"),'ei varattavissa')%]</h3> "/>

Should it works or have you experience with this?

dmarteau commented 2 years ago

There is also custom function in qgis profile folder.

Make sure that the environment variable QGIS_OPTIONS_PATH is correctly set when running the server.

See https://docs.qgis.org/3.22/en/docs/server_manual/config.html#environment-variables

lassitanskanen commented 2 years ago

I use default options path.

dmarteau commented 2 years ago

I use default options path.

This may be undefined: that depends how you start the server (if you use Docker then there is no such thing as default options path and you must bind mount the profile directory explicitely)

To make sure that your are using the correct profile provide a QGIS_OPTIONS_PATH environment variable that hold the path to the profile folder. Remember that the server is expected to run in its own environment (no qgis desktop around) and doesn't known about your Qgis desktop settings.

r9zzai commented 2 years ago

I've another question related to getfeatureinfo. Actual external wms layers shows no info onclick. It could be implented by js by identifying lizMap.layers .. url does not include lizMap.map.baseURI. For performance issues we actually clone projects and embed "internal" WMS layer so that all CPU cores are used. To overcome the issue that third party can see the "internal" wms link and probably can embed project layers into their own projects we create xml files with gdal_translate command and embed them instead of wms source layers. But now per js we cannot see then what layer is embedded externally (by url). What would be a better approach? Use internal wms without xml (gdal_wmts because gdal_wms dont respect layer transparency) and set credentials/auth? I made researches but it seems to be difficult to set auth for a qgis project. Another question is why it is not documented/worked on that using internal wms layer can use all CPU cores? I know its all about simplification (make no sense display 10 k features). But I think with project caching function of pyqgisserver big projects with 100+ layers will load in time the focus of multiprocessing will be rising. I like to have a big project rather than 3-4 small ones.

dmarteau commented 2 years ago

I've another question related to getfeatureinfo. Actual external wms layers shows no info onclick...

Sorry, but I dont see how that relates to the actual issue: It seems to to me that it is more a Qgis issue/question since py-qgis-server is a wrapper around Qgis server and that is related how Qgis handle external wms.