Many potential ProcessSpace users live in QGIS rather than R. There are three ways to bring the tool to them, in increasing order of effort. The first one already ships with this package.
QGIS’s Processing R Provider plugin runs R scripts as regular Processing-toolbox algorithms with auto-generated dialogs — layer pickers, numeric fields, folder browsers.
Setup (one time):
remotes::install_github("adamkc/ProcessSpace")).system.file("qgis/ProcessSpaceKMZ.rsx", package = "ProcessSpace")
into your QGIS R-scripts folder (shown in the same settings panel).“Process Space KMZ” then appears in the Processing Toolbox: select a stream layer (one contiguous, unbranched path — use Select Features first and run on the selection), point it at a DEM, set the stage levels, and it writes the PDF report and Google Earth KMZ.
Practical notes:
ProcessSpace::processSpace() — anything
you can do there can be exposed as another ##param line.
Copy and adapt the .rsx for variants (e.g. a detrend-method
comparison algorithm calling compareDetrendMethods()).A standalone QGIS plugin could bundle a CLI entry point and call
Rscript directly. This buys almost nothing over option 1
(users still need R) and takes on R-discovery and path-quoting fragility
across platforms. Skip it.
A native plugin with zero R dependency would reach the whole QGIS
audience: geometry via PyQGIS/shapely, sampling via GDAL, interpolation
via scipy/pykrige (or the nearest-stream-point
method, which is trivial in numpy), KML via simplekml,
figures via matplotlib. Realistically this is a separate multi-week
project that forks the codebase and doubles maintenance.
The sensible sequence: ship option 1, watch whether QGIS-side adoption materializes, and only then consider the port.