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

Need example for how to pass client-side data to an algorithm #35

Open
patrickkaleta opened this issue Mar 29, 2023 · 2 comments
Open

Comments

@patrickkaleta
Copy link

What I have

I currently have an algorithm that performs certain actions on an input layer. That layer is already included in a qgs project and I only need to provide the name of the layer as an input parameter.

What I need

I would now like to change the algorithm so that I can provide the actual layer (in my specific case a shape file) as an input parameter, but so far I haven't been able to achieve this.

My problem

In the docs under Contextualized input parameters it only says:

If you need to pass data to your algorithm from client-side, prefer inputs file parameter and small payloads.

Unfortunately, that didn't help me much further. Have tried it with both Postman and curl, but wasn't able to get it working. Can you provide a more detailed explanation on how something like that could be achieved?

Idea/reason behind all this

The already in the qgs project included layer gives a baseline reference. A user can download a copy of the original layer, edit it, re-run the algorithm and compare the results.

@dmarteau
Copy link
Member

From Qgis/Prcocesing side, do as usual: pass your parameter as File parameter. You will be able to test your Algorithm with qgis desktop.

From WPS client side, your input parameter will be a complex Input which may be either an uri reference or a base64 full payload (not recommended), depending on your workflow.

@patrickkaleta
Copy link
Author

Thanks for your feedback! We will give it a try and hopefully get it working. If you ever get the chance to extend the current docs with a working example (or provide it as a test in your code), it would certainly be much appreciated.

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

2 participants