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

Exposing Processing algorithms with py-qgis-wps and docker-compose #36

Closed
maborroto opened this issue Mar 30, 2023 · 6 comments
Closed

Comments

@maborroto
Copy link

maborroto commented Mar 30, 2023

Hello,
I'm trying to expose the processing algorithms with py-qgis-wps to be used with Lizmap. I'm using the docker-compose variant because it is easy to install and use. Everything went well until I decided to expose the "native" algorithms.
In the docker-compose.yml file, I set the provider property in this way:
QGSWPS_PROCESSING_EXPOSED_PROVIDERS: native,qgis

When executing docker compose up I'm getting the error reported below:
image

This error occurs just when using the "native" provider; if I use just the qgis (QGSWPS_PROCESSING_EXPOSED_PROVIDERS: qgis) provider, everything works well but I can't see the "native" algorithms, e.g. native:buffer

PD: I'm using the docker image: 3liz/qgis-wps:3.30, but I also used 3liz/qgis-wps:release-rc and 3liz/qgis-wps:ltr-rc, but i got the same error.

Can you give me some hints on how to solve this problem?

Thanks!!

@dmarteau
Copy link
Member

The answer is simple: you cannot expose the native provider .

Neither you should expose the qgis provider: theses algorithms have never been designed to work with WPS marshalling (remember that the input/output parameter's set in Qgis processing is much larger that what's possible to expose in WPS).

But you may wrap call to native/qgis algorithm into your own algorithm to fit specialized needs, which is more suited to be used as WPS service.

@maborroto
Copy link
Author

I got it, thank you a lot. I have written a custom algorithm wrapping the native:buffer, and it works perfectly.

@dmarteau
Copy link
Member

👍

@cBevilaqua
Copy link

I got it, thank you a lot. I have written a custom algorithm wrapping the native:buffer, and it works perfectly.

@maborroto , can you please send me the wrapper you made with the buffer algorithm? I need to do the same but have no idea how to do it. Thanks.

@Gustry
Copy link
Member

Gustry commented Jul 5, 2023

If I were you, I would go for a processing model, easier as it seems you are not familiar with PyQGIS (which is what the wrapper is about)

@cBevilaqua In your processing toolbox, you have a Python button at the top, "Create script from template" which is doing the wrapper more or less with the example provided.

@cBevilaqua
Copy link

cBevilaqua commented Jul 5, 2023

If I were you, I would go for a processing model, easier as it seems you are not familiar with PyQGIS (which is what the wrapper is about)

@cBevilaqua In your processing toolbox, you have a Python button at the top, "Create script from template" which is doing the wrapper more or less with the example provided.

Thanks!

I made a small example here: https://github.com/cBevilaqua/qgis-sample-processing, following the example here (https://docs.qgis.org/3.28/en/docs/user_manual/processing/scripts.html) and got it working.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants