-
Notifications
You must be signed in to change notification settings - Fork 20
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
How to specify multilayer input? #25
Comments
I'll look into tomorrow... multilayer out is serialized as a comma separated (unquoted) file list. But it looks like that didn't work here for input! Something else to try is specifying the argument twice with the same name... |
Update: I have tried to specify the argument twice, however, then only the second input is used. |
Ok -- this is a QGIS bug. There's no way to specify a list of layers from a string value alone. What do you think would be a safe way to handle this? Would |
For consistency, comma separated filenames? Only because that's what multilayer output is serialized to (maybe with a backslash escape on commas in a filename?). The field parameter takes semicolon separated values and enums are comma separated. JSON IO could also be a fallback for those who need arbitrary filename support (e.g. us). |
There's a potential fix here: qgis/QGIS#40287 |
Hi! I confirmed there was a bug in the implementation of multiple inputs in the |
Hey, sth like this enables to give a list to an argument.
The
|
I'm not entirely sure I understand, but I think you might be after something like this: author: DUNNINGTOND
|
This simplifies the task, thanks. I had a hard time passing a list of inputs or layers and found the method above. It'd be perfect if a user can give a list to |
This is fixed in #63 (use library(qgisprocess)
#> Using 'qgis_process' at '/Applications/QGIS-LTR.app/Contents/MacOS/bin/qgis_process'.
#> QGIS version: 3.16.10-Hannover
#> Metadata of 971 algorithms successfully cached.
#> Run `qgis_configure()` for details.
rstr <- system.file("longlake/longlake_depth.tif", package = "qgisprocess")
pts <- system.file("longlake/longlake_depth.gpkg", package = "qgisprocess")
qgis_run_algorithm(
"saga:addrastervaluestopoints",
SHAPES = pts,
GRIDS = qgis_list_input(rstr, rstr),
RESAMPLING = 0,
RESULT = qgis_tmp_vector(),
.quiet = TRUE
)
#> <Result of `qgis_run_algorithm("saga:addrastervaluestopoints", ...)`>
#> List of 1
#> $ RESULT: 'qgis_outputVector' chr "/var/folders/gt/l87wjg8s7312zs9s7c1fgs900000gn/T//Rtmpwv3nCd/file26603df4be17/file2660eebf7c8.gpkg" Created on 2021-08-31 by the reprex package (v2.0.1) |
I could not specify a QGIS argument of type multilayer. I tried a list of raster files, a list of raster files stored on disk, and since I knew that QGIS expects a Python list (see e.g., r-spatial/RQGIS3#4), I also tried to mimic a Python list.
Created on 2020-10-12 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: