qgis / qwc2-demo-app

QWC2 demo application
Other
240 stars 149 forks source link

Not able to create/show categorized layer? #524

Open 9ls1 opened 4 months ago

9ls1 commented 4 months ago

I'm using qwc-docker generating themes from qwc-admin-gui. image

Despite following the instructions from Split categorized layers , the layer is not splitted (categorized) in QWC2 as it is in QGIS.

QGIS image

QWC2 image

split_categorized.py is downloaded and saved in volumes/qgis-server-plugins/split_categorized image

qwc-qgis-server container is configured:

qwc-qgis-server: image: sourcepole/qwc-qgis-server:3.28-plugins

ports:

#   - "127.0.0.1:8001:80"
volumes:
  - ./volumes/qgs-resources:/data:ro
  - ./pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
  - ./volumes/qgis-server-plugins/split_categorized:/usr/share/qgis/python/plugins/split_categorized:ro

The layer has a variable convert_categorized_layer true. image

Then I successfully generate themes configuration. However, the layer is not splitted (see images above).

Any idea where I go wrong?

manisandro commented 4 months ago

If you enable INFO logging in qgis server:

  qwc-qgis-server:
    environment:
      QGIS_SERVER_LOG_LEVEL: 0

do you see in the qwc-qgis-server-log the following log entry?

qwc-qgis-server_1              | 09:05:19 INFO Server[73]: Server plugin split_categorized loaded!
9ls1 commented 4 months ago

@manisandro Thanks, I enabled INFO-logging, but I'm not able to find/see qwc-qgis-server-log? However, I have located /var/lib/docker/containers and had a look in the qwc-qgis-server container (xxxx-json.log, finding the contianer id xxxx with sudo docker ps), and can't find any string containing 'split'. Not a good sign, I assume. (I have INFO Server[72] and INFO Server[109 ] - if this means anything.)

manisandro commented 4 months ago

You can see the log via docker-compose logs -f qwc-qgis-server

9ls1 commented 4 months ago

@manisandro Thanks for the command making log-retrieving much easier. However, no sign of split in the log log_qgis_server_20240207_01.txt

manisandro commented 4 months ago

So the plugin probably isn't mounted correctly, or the docker container not recreated with the new configuration. Did you recreate the server container with docker-compose up qwc-qgis-server after changing the configuration in the compose file?

9ls1 commented 4 months ago

@manisandro Yes, I have tried several things like restarting docker, stopping docker and starting docker, recreating the server container, but without any luck in seeing "Server plugin split_categorized loaded!" nor splitted layers in QWC2. The split_categorized.py is placed in /xxx/xxx/qwc-docker/volumes/qgis-server-plugins/split_categorized corresponding to the instructions: ...

volumes:

-./volumes/qgis-server-plugins/split_categorized:/usr/share/qgis/python/plugins/split_categorized:ro

... Not sure how else to mount the plugin.

manisandro commented 4 months ago

Last idea would be to docker-compose exec qwc-qgis-server bash and then check within the docker container that the plugin files are indeed there as expected and readable.

9ls1 commented 4 months ago

@manisandro Thanks for you time and help. Yes, I do find the plugin in expected(?) folder:

www-data@e3409b73647a:/usr/share/qgis/python/plugins/split_categorized$ ls -l total 8 -rwxr-xr-x 1 root root 6938 Feb 7 12:57 split_categorized.py www-data@e3409b73647a:/usr/share/qgis/python/plugins/split_categorized$

Originally it was user and group like 1003 and 1005 respectively - no luck. It was then changed to root root - didn't help. In the log I see:

... qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Plugin PATH: /usr/lib/qgis/plugins qwc-qgis-server-1 | 11:38:31 INFO Server[72]: PkgData PATH: /usr/share/qgis qwc-qgis-server-1 | 11:38:31 INFO Server[72]: User DB PATH: /etc/qgis.db qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Auth DB PATH: /var/lib/qgis/qgis-auth.db qwc-qgis-server-1 | 11:38:31 INFO Server[72]: SVG PATHS: /usr/share/qgis/svg/:/etc/svg/ qwc-qgis-server-1 | "Loading native module /usr/lib/qgis/server/libdummy.so" qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Adding service SampleService 1.0 qwc-qgis-server-1 | "Loading native module /usr/lib/qgis/server/liblandingpage.so" qwc-qgis-server-1 | 11:38:31 INFO [72]: Adding API Landing Page qwc-qgis-server-1 | "Loading native module /usr/lib/qgis/server/libwcs.so" qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Adding service WCS 1.0.0 qwc-qgis-server-1 | "Loading native module /usr/lib/qgis/server/libwfs.so" qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Adding service WFS 1.1.0 qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Adding service WFS 1.0.0 qwc-qgis-server-1 | "Loading native module /usr/lib/qgis/server/libwfs3.so" qwc-qgis-server-1 | 11:38:31 INFO [72]: Adding API OGC WFS3 (Draft) qwc-qgis-server-1 | "Loading native module /usr/lib/qgis/server/libwms.so" qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Adding service WMS 1.3.0 qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Adding service WMS 1.1.1 qwc-qgis-server-1 | "Loading native module /usr/lib/qgis/server/libwmts.so" qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Adding service WMTS 1.0.0 qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Initializing 'filesystem' cache strategy qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Server initialized qwc-qgis-server-1 | 11:38:31 INFO ./src/server/qgsserverplugins.cpp[72]: load library /usr/lib/qgispython (3.28.15) qwc-qgis-server-1 | 11:38:31 INFO ./src/server/qgsserverplugins.cpp[72]: Python support library loaded successfully. qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Server plugin ClearCapabilities loaded! qwc-qgis-server-1 | 11:38:31 INFO Server[72]: Server python plugins loaded qwc-qgis-server-1 | 11:38:31 INFO Server[72]: **** New request *** ...

I note Plugin PATH: /usr/lib/qgis/plugins (and not /usr/share/qgis/plugins) and the only "loaded!" I find is "Server plugin ClearCapabilities loaded!".

Must the owner of the folder qgis-server-plugins (/xxx/xxx/qwc-docker/volumes/qgis-server-plugins) be root?