3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
257 stars 144 forks source link

Calc is Possible? #3569

Closed webgis87 closed 1 year ago

webgis87 commented 1 year ago

What is the question?

Hello everyone, I wanted to know if it was possible to perform calculation operations on Lizmap. Or use actions to run python scripts, and how can I achieve that. For example, to calculate the hydraulic invariance in a point or in an area

Versions

lizmap 3.6

Check Lizmap plugin

QGIS server version, only if the section above doesn't mention the QGIS Server version

3.22

Operating system

ubuntu server

Browsers

Microsoft Edge

Browsers version

92

Relevant log output

No response

mdouchin commented 1 year ago

You can, with actions and some PostgreSQL "magic". See : https://docs.lizmap.com/3.6/en/publish/configuration/action_popup.html Improvements are coming in future 3.7.0: https://github.com/3liz/lizmap-web-client/pull/3343

webgis87 commented 1 year ago

Many thanks you. It possibile tutorial/coure buy?

webgis87 commented 1 year ago

good morning, forgive my poor French but it is based on the automatic google translator.

I have been following the development and evolution of Lizmap for several years, which I believe has now reached the highest levels, and consequently, despite being very well structured and supported by guides, I wanted to ask you if it was possible for you to start online training regarding some aspects that do not appear clear to me and the references in Italian are a bit backdated.

In particular, I need to better understand how an action is created on lizmap, in particular the one to recall a python command and execute it, in the same way as the MapBuilder.

Confident of your interest, I take this opportunity to send cordial greetings

Gustry commented 1 year ago

Thanks for your message 😉

Did you check and try the demo about actions ? https://demo.lizmap.com/lizmap/index.php/view/map?repository=features&project=fire_hydrant_actions

You can download the ZIP and explore it to see how it's done on your own server.

in particular the one to recall a python command and execute it, in the same way as the MapBuilder.

Actions are only running SQL commands, it's not possible to run Python commands straight. (if you really want to use Python, it would be with PlPython...) :/

webgis87 commented 1 year ago

yes I saw the demo online, but the layers are not usable because it asks for access to a pg_service file. In any case, I didn't quite understand how to use the instructions, do you have any longer references I can follow?

webgis87 commented 1 year ago

yes I saw the demo online, but the layers are not usable because it asks for access to a pg_service file. In any case, I didn't quite understand how to use the instructions, do you have any longer references I can follow?

Gustry commented 1 year ago
  1. Load the SQL in your database
  2. Either to have a service called PG_SERVICE according to the PostgreSQL documentation and similar to an existing one in LWC. The most difficult part is to know where you can put this file or to define PGSERVICEFILE
  3. Open the QGS project

Or :

  1. Load the SQL in your database
  2. Open the QGS project
  3. Press "Ignore for 10 seconds" image
  4. Either edit the datasource manually, or press gain "Keep unavailable layers" image
  5. On a unavailable layer, do this : ksnip_20230331-093002
  6. Pick the layer you have imported in your database

I will add these notes and screenshots in the README.me which is included in the ZIP, for the next update.

Gustry commented 1 year ago

I moved the notes in the GitHub repository : https://github.com/3liz/lizmap-web-client-demo/blob/master/INSTALLATION.md

A file has been included as well in each ZIP to link to this online help.

3liz-bot commented 1 year ago

This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎