Open aloboa opened 2 weeks ago
This is exactly why I came here ☝🏼 (I literally just tooted this)
The ability to create a QGIS project XML from this package would be an awesome feature 💯
Thanks for sharing the enthusiasm :slightly_smiling_face:. Several things are to be considered.
qgis_process
CLI utility, hence on geoprocessing algorithms that need input objects and generate output object(s), without the need for a QGIS project. This helps reproducibility at the R side of things. That will remain the core aim.qgis_launch(list(object_1, "filepath A", object_2))
, that would call the qgis
CLI utility (which is in the same directory as qgis_process
), which accepts filepaths (it could perhaps be extended later with more arguments since that tool has more options). I understand this may come in handy for quick visual exploration in QGIS.
as_qgis_argument()
to derive file paths, as it does for qgis_run_algorithm()
.qgis_launch()
(above) the package would just defer further handling of files, CRS settings etc to QGIS; the user can then adjust things interactively in the GUI, and save as a project if needed. Directly creating or updating QGIS projects or interacting with them will better fit in another package.Thank you very much for your valuable thoughts on this! Quick question: I can't seem to find anything on the qgis
CLI utility you mention, is this documented anywhere?
I understand the confusion. I just mean the QGIS executable, which one can call from the command line, and from the command line it can take arguments (files in this case) and options. In a bash environment, its documentation is available with man qgis
. I'm not sure whether this documentation is rendered somewhere on the web, but might be.
As far as I can see, the qgis command line options let the user open the layers, which I have been able to do such as:
qcomm <- paste("qgis", file.path(dirdata, "DI17_2_labels_R.tif"), "./DI17autoseg12/DI17_2_autoseg12.shp", "&")
system(qcomm)
but styling would need to be done through xml "QGIS layer definition files (.qlr)"
I often do raster and vector processing using package terra and alike. At some point, I need to visualize results in Qgis. As soon as the results imply multiple raster and vector layers, a function to write an ad-hoc Qgis project would be great advantage.