Open zacharlie opened 2 years ago
I tried to run the clip outputting to raster and it works on my machine running Q3.26
qgis_process run gdal:cliprasterbyextent --distance_units=meters --area_units=m2 --ellipsoid=EPSG:7030 --INPUT=/gis/src/kartoza_work/geodata-mart/geodata/test/projects/dem.tif --PROJWIN='23.750467063,25.932131664,-29.223057891,-27.450455402 [EPSG:4326]' --OVERCRS=false --OPTIONS= --DATA_TYPE=0 --EXTRA= --OUTPUT=/tmp/demo1.gpkg
I'll need to do further tests on that, but will focus efforts on 3.22 (maybe switching to 3.28 in October) so that we can make sure whatever processes we decide on are compatible with an LTR. It's a bit of a struggle to work against inconsistent results. For now I am parking the WPS support as it's rather difficult to debug, and running django against a QGIS container to execute custom scripts via a celery worker. The updated clipping script is storing rasters on the file system adjacent to the geopackage, and then zipping everything up as an output. I think pushing that output to a project defined S3 bucket might be the next step forward, and once that is running smoothly I'll revisit using WPS and storing rasters in the gpkg directly...
Ok, cool so if I want to test the whole process do I just use your develop branch and start debugging from there
Yeah I think that is the best approach for now... Although if you want to run more tests against WPS directly (especially with OWSLib) for running custom models and scripts I think that is the highest value, because it can be used in this stack and for other projects
Ideally we should be in a position to leverage the py-qgis-wps framework for a scalable and powerful approach to backend processing, which provides a status api and provides many of the benefits of a generic WPS, along with direct support for qgis providers, plugins, scripts, and models.
A simple stack can be setup up with the following
docker-compose.yaml
:The initial script developed for testing is on my development branch under commit c42ca95, which can be downloaded directly from github:
The "test" directory contains a small sample data set that can be used for evaluation:
Note that QGIS Processing will require the script to be added to the default profile, as the processing framework does not currently support profiles. The script can be run locally with QGIS Processing, e.g.
This produces a zip file with gpkg and associated rasters
Storing the raster to geopackage does not work within the processing framework. When using the CLI, it throws an error. When using the same processing script from the QGIS GUI (3.26) it throws an error, but writes the output raster to the geopackage. When using the processing tools driectly in QGIS, it works. The RASTER_TABLE parameter does not work properly though unless used as TABLE.
Instead of a single clip and transform with GDAL, instead a multi-step process has been used to try identify or address issues as a work around, with the geopackage output raster process being commented out and replaced with a flat file output raster to include in a zip.
Assessing the WPS capabilities, operations, input, and output requirements can be performed with OWSLib, or alternatively, with a little mor work, vanilla requests as outlined by the py-qgis-wps tests.
OWSLib is easily installed with conda and is utilised as demonstrated below:
Execute process:
The result is an "internal error" which has not been resolved despite various attempted workarounds and experiments.
Using the template processing script from QGIS (simple vector buffer), works with the WPS and compose stack provided.
In the meantime, the plan is to use QGIS Processing directly in the django/ celery containers and revisit the WPS utilization later.