-
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
Older SAGA versions (< 8) don't work well with GeoTIFF #166
Comments
@florisvdh I have the same problem with the latest version of qgisprocess. remotes::install_github("r-spatial/qgisprocess@maintenance") qgis_run_algorithm(
algorithm = "sagang:sagawetnessindex",
DEM = dem,
TWI = 'twi.sdat') |>
qgis_extract_output(name="TWI") |>
st_as_stars() |>
rast() |>
plot(col = cptcity::cpt(pal = 'ocal_blue')) |
I installed the maintenance version.
|
ohhhh , @tylerbhampton the algoritm is |
I get this message when I ask for help with "sagang:sagawetnessindex"
|
I updated the Processing Saga NextGen provider in QGIS. As seen in code attached below: I am able to get the qgisprocess package to SUCCESSFULLY work for the vector analysis example of buffer NC, but still CANNOT for the raster example. I show that the RSAGA package can successfully perform the analysis. My error message is that the qgisprocess "qgis_run_algorithm" function never writes an output file. library(qgisprocess)
|
Thanks for your interest @tylerbhampton. From your output, it appears that Maybe you didn't load terra before using Can you reproduce below reprex, that does it with stars, terra and raster (to report problems, best use Reprexlibrary(terra)
#> terra 1.7.37
library(qgisprocess)
#> Attempting to load the cache ...
#> Success!
#> QGIS version: 3.32.0-Lima
#> Having access to 1868 algorithms from 13 QGIS processing providers.
#> Run `qgis_configure(use_cached_data = TRUE)` to reload cache and get more details.
dem <- rast(system.file("raster/dem.tif", package = "spDataLarge"))
twi_output <- qgis_run_algorithm(
algorithm = "sagang:sagawetnessindex",
DEM = dem,
TWI = 'twi.sdat') |>
qgis_extract_output(name="TWI")
#> Argument `WEIGHT` is unspecified (using QGIS default value).
#> Using `AREA = qgis_tmp_raster()`
#> Using `SLOPE = qgis_tmp_raster()`
#> Using `AREA_MOD = qgis_tmp_raster()`
#> Argument `SUCTION` is unspecified (using QGIS default value).
#> Using `AREA_TYPE = "[0] total catchment area"`
#> Using `SLOPE_TYPE = "[0] local slope"`
#> Argument `SLOPE_MIN` is unspecified (using QGIS default value).
#> Argument `SLOPE_OFF` is unspecified (using QGIS default value).
#> Argument `SLOPE_WEIGHT` is unspecified (using QGIS default value).
twi_output |>
qgis_as_terra() |>
plot(col = cptcity::cpt(pal = 'ocal_blue')) twi_output |>
stars::st_as_stars() |>
plot(col = cptcity::cpt(pal = 'ocal_blue')) twi_output |>
qgis_as_raster() |>
plot(col = cptcity::cpt(pal = 'ocal_blue'))
#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
#> which was just loaded, will retire in October 2023.
#> Please refer to R-spatial evolution reports for details, especially
#> https://r-spatial.org/r/2023/05/15/evolution4.html.
#> It may be desirable to make the sf package available;
#> package maintainers should consider adding sf to Suggests:.
#> The sp package is now running under evolution status 2
#> (status 2 uses the sf package in place of rgdal) # also the (unneeded) roundtripping works:
twi_output |>
stars::st_as_stars() |>
rast() |>
plot(col = cptcity::cpt(pal = 'ocal_blue')) Created on 2023-07-12 with reprex v2.0.2 Session infosessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.1 (2023-06-16)
#> os Linux Mint 21.1
#> system x86_64, linux-gnu
#> ui X11
#> language nl_BE:nl
#> collate nl_BE.UTF-8
#> ctype nl_BE.UTF-8
#> tz Europe/Brussels
#> date 2023-07-12
#> pandoc 3.1.1 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> abind 1.4-5 2016-07-21 [3] CRAN (R 4.2.0)
#> assertthat 0.2.1 2019-03-21 [3] CRAN (R 4.0.1)
#> class 7.3-22 2023-05-03 [3] RSPM (R 4.2.0)
#> classInt 0.4-9 2023-02-28 [3] RSPM (R 4.2.0)
#> cli 3.6.1 2023-03-23 [3] RSPM (R 4.2.0)
#> codetools 0.2-19 2023-02-01 [3] RSPM (R 4.2.0)
#> cptcity 1.0.6 2020-10-02 [3] RSPM (R 4.2.0)
#> curl 5.0.1 2023-06-07 [3] RSPM (R 4.2.0)
#> DBI 1.1.3 2022-06-18 [3] RSPM (R 4.2.0)
#> digest 0.6.32 2023-06-26 [3] RSPM (R 4.2.0)
#> dplyr 1.1.2 2023-04-20 [3] RSPM (R 4.2.0)
#> e1071 1.7-13 2023-02-01 [3] RSPM (R 4.2.0)
#> evaluate 0.21 2023-05-05 [3] RSPM (R 4.2.0)
#> fansi 1.0.4 2023-01-22 [3] RSPM (R 4.2.0)
#> fastmap 1.1.1 2023-02-24 [3] RSPM (R 4.2.0)
#> fs 1.6.2 2023-04-25 [3] RSPM (R 4.2.0)
#> generics 0.1.3 2022-07-05 [3] RSPM (R 4.2.0)
#> glue 1.6.2 2022-02-24 [3] RSPM (R 4.2.0)
#> highr 0.10 2022-12-22 [3] RSPM (R 4.2.0)
#> htmltools 0.5.5 2023-03-23 [3] RSPM (R 4.2.0)
#> jsonlite 1.8.7 2023-06-29 [3] RSPM (R 4.2.0)
#> KernSmooth 2.23-21 2023-05-03 [3] RSPM (R 4.2.0)
#> knitr 1.43 2023-05-25 [3] RSPM (R 4.2.0)
#> lattice 0.21-8 2023-04-05 [3] RSPM (R 4.2.0)
#> lifecycle 1.0.3 2022-10-07 [3] RSPM (R 4.2.0)
#> lwgeom 0.2-13 2023-05-22 [3] RSPM (R 4.2.0)
#> magrittr 2.0.3 2022-03-30 [3] RSPM (R 4.2.0)
#> pillar 1.9.0 2023-03-22 [3] RSPM (R 4.2.0)
#> pkgconfig 2.0.3 2019-09-22 [3] CRAN (R 4.0.1)
#> processx 3.8.2 2023-06-30 [3] RSPM (R 4.2.0)
#> proxy 0.4-27 2022-06-09 [3] RSPM (R 4.2.0)
#> ps 1.7.5 2023-04-18 [3] RSPM (R 4.2.0)
#> purrr 1.0.1 2023-01-10 [3] RSPM (R 4.2.0)
#> qgisprocess * 0.0.0.9000 2023-07-12 [1] Github (r-spatial/qgisprocess@2f7ea70)
#> R.cache 0.16.0 2022-07-21 [3] RSPM (R 4.2.0)
#> R.methodsS3 1.8.2 2022-06-13 [3] RSPM (R 4.2.0)
#> R.oo 1.25.0 2022-06-12 [3] RSPM (R 4.2.0)
#> R.utils 2.12.2 2022-11-11 [3] RSPM (R 4.2.0)
#> R6 2.5.1 2021-08-19 [3] RSPM (R 4.2.0)
#> rappdirs 0.3.3 2021-01-31 [3] RSPM (R 4.2.0)
#> raster 3.6-23 2023-07-04 [3] RSPM (R 4.2.0)
#> Rcpp 1.0.10 2023-01-22 [3] RSPM (R 4.2.0)
#> reprex 2.0.2 2022-08-17 [3] RSPM (R 4.2.0)
#> rlang 1.1.1 2023-04-28 [3] RSPM (R 4.2.0)
#> rmarkdown 2.23 2023-07-01 [3] RSPM (R 4.2.0)
#> rstudioapi 0.14 2022-08-22 [3] RSPM (R 4.2.0)
#> sessioninfo 1.2.2 2021-12-06 [3] RSPM (R 4.2.0)
#> sf 1.0-13 2023-05-24 [1] RSPM (R 4.3.0)
#> sp 2.0-0 2023-06-22 [3] RSPM (R 4.2.0)
#> stars 0.6-1 2023-04-06 [3] RSPM (R 4.2.0)
#> stringi 1.7.12 2023-01-11 [3] RSPM (R 4.2.0)
#> stringr 1.5.0 2022-12-02 [3] RSPM (R 4.2.0)
#> styler 1.10.1 2023-06-05 [3] RSPM (R 4.2.0)
#> terra * 1.7-37 2023-06-18 [1] RSPM (R 4.3.0)
#> tibble 3.2.1 2023-03-20 [3] RSPM (R 4.2.0)
#> tidyselect 1.2.0 2022-10-10 [3] RSPM (R 4.2.0)
#> units 0.8-2 2023-04-27 [3] RSPM (R 4.2.0)
#> utf8 1.2.3 2023-01-31 [3] RSPM (R 4.2.0)
#> vctrs 0.6.3 2023-06-14 [3] RSPM (R 4.2.0)
#> withr 2.5.0 2022-03-03 [3] RSPM (R 4.2.0)
#> xfun 0.39 2023-04-20 [3] RSPM (R 4.2.0)
#> xml2 1.3.4 2023-04-27 [3] RSPM (R 4.2.0)
#> yaml 2.3.7 2023-01-23 [3] RSPM (R 4.2.0)
#>
#> [1] /home/floris/lib/R/library
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library
#>
#> ────────────────────────────────────────────────────────────────────────────── Thanks @ambarja for solving several things! |
I reinstalled spDataLarge to make sure we're using the same DEM raster. library(terra)
#> terra 1.7.39
library(qgisprocess)
#> Attempting to load the cache ...
#> Success!
#> QGIS version: 3.28.8-Firenze
#> Having access to 1673 algorithms from 8 QGIS processing providers.
#> Run `qgis_configure(use_cached_data = TRUE)` to reload cache and get more details.
#> >>> Run `qgis_enable_plugins()` to enable 1 disabled plugin and access
#> its algorithms: otbprovider
qgis_enable_plugins(names=c("processing_saga_nextgen"))
#> Ignoring plugins that are enabled already: processing_saga_nextgen
#> No QGIS plugins to be handled; exiting.
dem = rast(system.file("raster/dem.tif",
package="spDataLarge"))
plot(dem)
twi_output = qgis_run_algorithm(
algorithm = "sagang:sagawetnessindex",
DEM = system.file("raster/dem.tif",
package="spDataLarge"),
TWI = "twi.sdat") |> qgis_extract_output(name="TWI")
#> Argument `WEIGHT` is unspecified (using QGIS default value).
#> Using `AREA = qgis_tmp_raster()`
#> Using `SLOPE = qgis_tmp_raster()`
#> Using `AREA_MOD = qgis_tmp_raster()`
#> Argument `SUCTION` is unspecified (using QGIS default value).
#> Using `AREA_TYPE = "[0] total catchment area"`
#> Using `SLOPE_TYPE = "[0] local slope"`
#> Argument `SLOPE_MIN` is unspecified (using QGIS default value).
#> Argument `SLOPE_OFF` is unspecified (using QGIS default value).
#> Argument `SLOPE_WEIGHT` is unspecified (using QGIS default value).
"twi.sdat" %in% list.files()
#> [1] FALSE
twi_output |>
qgis_as_terra() |>
plot()
#> Warning:
#> C:/Users/Tyler/AppData/Local/Temp/RtmpOOwHcn/reprex-51e8309f44b5-white-boto/twi.sdat:
#> No such file or directory (GDAL error 4)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': [rast] file does not exist: C:/Users/Tyler/AppData/Local/Temp/RtmpOOwHcn/reprex-51e8309f44b5-white-boto/twi.sdat
twi_output |>
stars::st_as_stars() |>
plot()
#> trying to read file: C:\Users\Tyler\AppData\Local\Temp\RtmpOOwHcn\reprex-51e8309f44b5-white-boto\twi.sdat
#> Error in (function (cond) : error in evaluating the argument 'x' in selecting a method for function 'plot': file not found twi_output |>
qgis_as_raster() |>
plot()
#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
#> which was just loaded, will retire in October 2023.
#> Please refer to R-spatial evolution reports for details, especially
#> https://r-spatial.org/r/2023/05/15/evolution4.html.
#> It may be desirable to make the sf package available;
#> package maintainers should consider adding sf to Suggests:.
#> The sp package is now running under evolution status 2
#> (status 2 uses the sf package in place of rgdal)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'plot': C:/Users/Tyler/AppData/Local/Temp/RtmpOOwHcn/reprex-51e8309f44b5-white-boto/twi.sdat does not exist Created on 2023-07-12 with reprex v2.0.2 Session infosessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.1 (2023-06-16 ucrt)
#> os Windows 10 x64 (build 19045)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_Canada.utf8
#> ctype English_Canada.utf8
#> tz America/Toronto
#> date 2023-07-12
#> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> ! package * version date (UTC) lib source
#> abind 1.4-5 2016-07-21 [1] CRAN (R 4.0.0)
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
#> class 7.3-22 2023-05-03 [2] CRAN (R 4.3.1)
#> classInt 0.4-9 2023-02-28 [1] CRAN (R 4.2.3)
#> cli 3.6.1 2023-03-23 [1] CRAN (R 4.2.3)
#> codetools 0.2-19 2023-02-01 [2] CRAN (R 4.3.1)
#> curl 5.0.1 2023-06-07 [1] CRAN (R 4.3.1)
#> DBI 1.1.3 2022-06-18 [1] CRAN (R 4.2.0)
#> digest 0.6.32 2023-06-26 [1] CRAN (R 4.3.1)
#> dplyr 1.1.2 2023-04-20 [1] CRAN (R 4.2.3)
#> e1071 1.7-13 2023-02-01 [1] CRAN (R 4.2.3)
#> evaluate 0.21 2023-05-05 [1] CRAN (R 4.2.3)
#> fansi 1.0.4 2023-01-22 [1] CRAN (R 4.2.3)
#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.2.3)
#> fs 1.6.2 2023-04-25 [1] CRAN (R 4.2.3)
#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.2.1)
#> D glue 1.6.2 2022-02-24 [1] CRAN (R 4.2.0)
#> highr 0.10 2022-12-22 [1] CRAN (R 4.2.2)
#> htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.2.3)
#> jsonlite 1.8.7 2023-06-29 [1] CRAN (R 4.3.1)
#> KernSmooth 2.23-21 2023-05-03 [2] CRAN (R 4.3.1)
#> knitr 1.43 2023-05-25 [1] CRAN (R 4.2.3)
#> lattice 0.21-8 2023-04-05 [1] CRAN (R 4.2.3)
#> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.2.2)
#> lwgeom 0.2-13 2023-05-22 [1] CRAN (R 4.2.3)
#> D magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.0)
#> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.2.3)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.2.0)
#> processx 3.8.2 2023-06-30 [1] CRAN (R 4.3.1)
#> proxy 0.4-27 2022-06-09 [1] CRAN (R 4.2.0)
#> ps 1.7.5 2023-04-18 [1] CRAN (R 4.2.3)
#> qgisprocess * 0.0.0.9000 2023-07-11 [1] Github (r-spatial/qgisprocess@3b01cfe)
#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.2.0)
#> rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.0.3)
#> raster 3.6-23 2023-07-04 [1] CRAN (R 4.3.1)
#> Rcpp 1.0.11 2023-07-06 [1] CRAN (R 4.3.1)
#> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.2.1)
#> rlang 1.1.1 2023-04-28 [1] CRAN (R 4.2.3)
#> rmarkdown 2.23 2023-07-01 [1] CRAN (R 4.3.1)
#> rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.2.1)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.1.3)
#> sf 1.0-14 2023-07-11 [1] CRAN (R 4.3.1)
#> sp 2.0-0 2023-06-22 [1] CRAN (R 4.3.1)
#> stars 0.6-1 2023-04-06 [1] CRAN (R 4.2.3)
#> stringi 1.7.12 2023-01-11 [1] CRAN (R 4.2.2)
#> stringr 1.5.0 2022-12-02 [1] CRAN (R 4.2.2)
#> terra * 1.7-39 2023-06-23 [1] CRAN (R 4.3.1)
#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.2.3)
#> tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.2.2)
#> units 0.8-2 2023-04-27 [1] CRAN (R 4.2.3)
#> utf8 1.2.3 2023-01-31 [1] CRAN (R 4.2.3)
#> vctrs 0.6.3 2023-06-14 [1] CRAN (R 4.3.1)
#> withr 2.5.0 2022-03-03 [1] CRAN (R 4.2.0)
#> xfun 0.39 2023-04-20 [1] CRAN (R 4.2.3)
#> xml2 1.3.4 2023-04-27 [1] CRAN (R 4.2.3)
#> yaml 2.3.7 2023-01-23 [1] CRAN (R 4.2.3)
#>
#> [1] C:/Users/Tyler/AppData/Local/R/win-library/4.3
#> [2] C:/Program Files/R/R-4.3.1/library
#>
#> D ── DLL MD5 mismatch, broken installation.
#>
#> ────────────────────────────────────────────────────────────────────────────── |
Thanks for the reprex; note that your previous output showed I cannot reproduce your issue with SAGA 8.2.2. So it may have to do with SAGA versions too, as in #149 (comment). You could try to add Some more things you can do to debug this:
Anyhow, from your output it appears that QGIS successfully runs the SAGA algorithm, but for some reason you miss the output files. Maybe this is because SAGA 8.5.1 behaves differently than expected. |
This odd behavior is well-known. Best try here is to make the output of type .tif as @florisvdh already suggested. |
One more observation. It often seemed to me as if the sdat output works on Unix systems, and the tif output under Windows for SAGA algorithms. |
Hey everyone, I was not having success with any combination of tif/sdat tif/tif as inputs/outputs. (I also checked that sdat/tif combo did not work). Only when I re-wrote the input file as sdat and specified output as sdat was it successful. load packagelibrary(terra)
#> terra 1.7.39
library(qgisprocess)
#> Attempting to load the cache ...
#> Success!
#> QGIS version: 3.28.8-Firenze
#> Having access to 1673 algorithms from 8 QGIS processing providers.
#> Run `qgis_configure(use_cached_data = TRUE)` to reload cache and get more details.
#> >>> Run `qgis_enable_plugins()` to enable 1 disabled plugin and access
#> its algorithms: otbprovider
qgis_enable_plugins(names=c("processing_saga_nextgen"))
#> Ignoring plugins that are enabled already: processing_saga_nextgen
#> No QGIS plugins to be handled; exiting.
FAILED ATTEMPT WITH TIF FILE FORMAT#### TRY WITH TIF FILE FORMAT ####
unlink("twi*")
dem = rast(system.file("raster/dem.tif",
package="spDataLarge"))
twi_output = qgis_run_algorithm(
algorithm = "sagang:sagawetnessindex",
DEM = dem,
TWI = "twi.tif"
) |> qgis_extract_output(name="TWI")
"twi.tif" %in% list.files()
#> [1] FALSE
unlink("twi*")
twi_output = qgis_run_algorithm(
algorithm = "sagang:sagawetnessindex",
DEM = dem,
TWI = "twi.sdat"
) |> qgis_extract_output(name="TWI")
"twi.sdat" %in% list.files()
#> [1] FALSE
SUCCESSFUL ATTEMPT WITH SDAT FILE FORMAT#### TRY WITH SDAT FILE FORMAT ####
unlink("twi*")
dem = rast(system.file("raster/dem.tif",
package="spDataLarge"))
writeRaster(dem,"dem.sdat")
#> Warning: Unable to set GeoTransform, SAGA binary grids only support the same cellsize in x-y.
#> (GDAL error 6)
"dem.sdat" %in% list.files()
#> [1] TRUE
twi_output = qgis_run_algorithm(
algorithm = "sagang:sagawetnessindex",
DEM = "dem.sdat",
TWI = "twi.sdat"
) |> qgis_extract_output(name="TWI")
#> Argument `WEIGHT` is unspecified (using QGIS default value).
#> Using `AREA = qgis_tmp_raster()`
#> Using `SLOPE = qgis_tmp_raster()`
#> Using `AREA_MOD = qgis_tmp_raster()`
#> Argument `SUCTION` is unspecified (using QGIS default value).
#> Using `AREA_TYPE = "[0] total catchment area"`
#> Using `SLOPE_TYPE = "[0] local slope"`
#> Argument `SLOPE_MIN` is unspecified (using QGIS default value).
#> Argument `SLOPE_OFF` is unspecified (using QGIS default value).
#> Argument `SLOPE_WEIGHT` is unspecified (using QGIS default value).
"twi.sdat" %in% list.files()
#> [1] TRUE SUCCESSFUL PLOTStwi_output |>
qgis_as_terra() |>
plot() twi_output |>
stars::st_as_stars() |>
plot() twi_output |>
qgis_as_raster() |>
plot() OTHER FAILED FILE COMBINATIONS# OTHER FAILED FILE COMBINATIONS
unlink("twi*")
twi_output = qgis_run_algorithm(
algorithm = "sagang:sagawetnessindex",
DEM = "dem.sdat",
TWI = "twi.tif"
) |> qgis_extract_output(name="TWI")
"twi.tif" %in% list.files()
#> [1] FALSE
unlink("twi*")
twi_output = qgis_run_algorithm(
algorithm = "sagang:sagawetnessindex",
DEM = "dem.sdat"#,
# DON'T SPECIFY OUTPUT FILE
#TWI =
) |> qgis_extract_output(name="TWI")
list.files(path=qgis_tmp_base())
#> character(0) Created on 2023-07-12 with reprex v2.0.2 Session infosessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.1 (2023-06-16 ucrt)
#> os Windows 10 x64 (build 19045)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_Canada.utf8
#> ctype English_Canada.utf8
#> tz America/Toronto
#> date 2023-07-12
#> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> ! package * version date (UTC) lib source
#> abind 1.4-5 2016-07-21 [1] CRAN (R 4.0.0)
#> assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
#> class 7.3-22 2023-05-03 [2] CRAN (R 4.3.1)
#> classInt 0.4-9 2023-02-28 [1] CRAN (R 4.2.3)
#> cli 3.6.1 2023-03-23 [1] CRAN (R 4.2.3)
#> codetools 0.2-19 2023-02-01 [2] CRAN (R 4.3.1)
#> curl 5.0.1 2023-06-07 [1] CRAN (R 4.3.1)
#> DBI 1.1.3 2022-06-18 [1] CRAN (R 4.2.0)
#> digest 0.6.32 2023-06-26 [1] CRAN (R 4.3.1)
#> dplyr 1.1.2 2023-04-20 [1] CRAN (R 4.2.3)
#> e1071 1.7-13 2023-02-01 [1] CRAN (R 4.2.3)
#> evaluate 0.21 2023-05-05 [1] CRAN (R 4.2.3)
#> fansi 1.0.4 2023-01-22 [1] CRAN (R 4.2.3)
#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.2.3)
#> fs 1.6.2 2023-04-25 [1] CRAN (R 4.2.3)
#> generics 0.1.3 2022-07-05 [1] CRAN (R 4.2.1)
#> D glue 1.6.2 2022-02-24 [1] CRAN (R 4.2.0)
#> highr 0.10 2022-12-22 [1] CRAN (R 4.2.2)
#> htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.2.3)
#> jsonlite 1.8.7 2023-06-29 [1] CRAN (R 4.3.1)
#> KernSmooth 2.23-21 2023-05-03 [2] CRAN (R 4.3.1)
#> knitr 1.43 2023-05-25 [1] CRAN (R 4.2.3)
#> lattice 0.21-8 2023-04-05 [1] CRAN (R 4.2.3)
#> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.2.2)
#> lwgeom 0.2-13 2023-05-22 [1] CRAN (R 4.2.3)
#> D magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.0)
#> pillar 1.9.0 2023-03-22 [1] CRAN (R 4.2.3)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.2.0)
#> processx 3.8.2 2023-06-30 [1] CRAN (R 4.3.1)
#> proxy 0.4-27 2022-06-09 [1] CRAN (R 4.2.0)
#> ps 1.7.5 2023-04-18 [1] CRAN (R 4.2.3)
#> qgisprocess * 0.0.0.9000 2023-07-11 [1] Github (r-spatial/qgisprocess@3b01cfe)
#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.2.0)
#> rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.0.3)
#> raster 3.6-23 2023-07-04 [1] CRAN (R 4.3.1)
#> Rcpp 1.0.11 2023-07-06 [1] CRAN (R 4.3.1)
#> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.2.1)
#> rlang 1.1.1 2023-04-28 [1] CRAN (R 4.2.3)
#> rmarkdown 2.23 2023-07-01 [1] CRAN (R 4.3.1)
#> rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.2.1)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.1.3)
#> sf 1.0-14 2023-07-11 [1] CRAN (R 4.3.1)
#> sp 2.0-0 2023-06-22 [1] CRAN (R 4.3.1)
#> stars 0.6-1 2023-04-06 [1] CRAN (R 4.2.3)
#> stringi 1.7.12 2023-01-11 [1] CRAN (R 4.2.2)
#> stringr 1.5.0 2022-12-02 [1] CRAN (R 4.2.2)
#> terra * 1.7-39 2023-06-23 [1] CRAN (R 4.3.1)
#> tibble 3.2.1 2023-03-20 [1] CRAN (R 4.2.3)
#> tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.2.2)
#> units 0.8-2 2023-04-27 [1] CRAN (R 4.2.3)
#> utf8 1.2.3 2023-01-31 [1] CRAN (R 4.2.3)
#> vctrs 0.6.3 2023-06-14 [1] CRAN (R 4.3.1)
#> withr 2.5.0 2022-03-03 [1] CRAN (R 4.2.0)
#> xfun 0.39 2023-04-20 [1] CRAN (R 4.2.3)
#> xml2 1.3.4 2023-04-27 [1] CRAN (R 4.2.3)
#> yaml 2.3.7 2023-01-23 [1] CRAN (R 4.2.3)
#>
#> [1] C:/Users/Tyler/AppData/Local/R/win-library/4.3
#> [2] C:/Program Files/R/R-4.3.1/library
#>
#> D ── DLL MD5 mismatch, broken installation.
#>
#> ────────────────────────────────────────────────────────────────────────────── |
Sharing outputs from QGIS as well. Just as with qgisprocess R package, QGIS failed to perform the SAGA Next Gen Wetness Index when reading the raster dem from its source in TIF format. But by reading the raster dem as SDAT file (that I had exported using R), the operation was successful (image attached). PS You all also helped me learn how to do dropdowns in github comments 😄 Failed QGIS Attempt with reading raster as TIF`QGIS version: 3.28.8-Firenze io_gdal 0 -TRANSFORM 1 -RESAMPLING 3 -GRIDS "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/101ea957b9f340a2ac586528939e3d98/dem.sgrd" -FILES "C:/Users/Tyler/AppData/Local/R/win-library/4.3/spDataLarge/raster/dem.tif" C:\Users\Tyler\Documents>set SAGA=C:/OSGeo4W/apps\saga C:\Users\Tyler\Documents>set SAGA_MLB=C:/OSGeo4W/apps\saga\modules C:\Users\Tyler\Documents>PATH=C:\OSGeo4W\apps\qgis-ltr\bin;C:\OSGeo4W\apps\grass\grass83\lib;C:\OSGeo4W\apps\grass\grass83\bin;C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\apps\Python39\Scripts;C:\OSGeo4W\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem;C:/OSGeo4W/apps\saga;C:/OSGeo4W/apps\saga\modules C:\Users\Tyler\Documents>saga_cmd io_gdal 0 -TRANSFORM 1 -RESAMPLING 3 -GRIDS "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/101ea957b9f340a2ac586528939e3d98/dem.sgrd" -FILES "C:/Users/Tyler/AppData/Local/R/win-library/4.3/spDataLarge/raster/dem.tif" ## ######## ### ## ## #### ###### ## ## ## ##### #SAGA Version: 7.8.2 (64 bit) 88 loaded tool libraries (775 tools):
*) tool chain libraries Error: select a library C:\Users\Tyler\Documents>saga_cmd ta_hydrology "SAGA Wetness Index" -DEM "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/101ea957b9f340a2ac586528939e3d98/dem.sgrd" -SUCTION 10.0 -AREA_TYPE 1 -SLOPE_TYPE 1 -SLOPE_MIN 0.0 -SLOPE_OFF 0.1 -SLOPE_WEIGHT 1.0 -AREA "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/733913777f344bdfbb00234ed2842006/AREA.sdat" -SLOPE "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/7d92f8c33d2145eead06c887e53e4d20/SLOPE.sdat" -AREA_MOD "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/6d512a0b11fd45778aef42298f1ad4ee/AREA_MOD.sdat" -TWI "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/3994e337771a4a61ab7d87c6063a4ee2/TWI.sdat" ## ######## ### ## ## #### ###### ## ## ## ##### #SAGA Version: 7.8.2 (64 bit) library path: C:\OSGeo4W\apps\saga\tools Loading grid: C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/101ea957b9f340a2ac586528939e3d98/dem.sgrd... Usage: saga_cmd ta_hydrology 15 [-DEM ] [-WEIGHT ] [-AREA ] [-SLOPE ] [-AREA_MOD ] [-TWI ] [-SUCTION ] [-AREA_TYPE ] [-SLOPE_TYPE ] [-SLOPE_MIN ] [-SLOPE_OFF ] [-SLOPE_WEIGHT ] C:\Users\Tyler\Documents>exit Loading resulting layers Successful QGIS Attempt with reading raster as SDAT`QGIS version: 3.28.8-Firenze ta_hydrology "SAGA Wetness Index" -DEM "D:/rtesting/rqgis_trouble/dem.sgrd" -SUCTION 10.0 -AREA_TYPE 1 -SLOPE_TYPE 1 -SLOPE_MIN 0.0 -SLOPE_OFF 0.1 -SLOPE_WEIGHT 1.0 -AREA "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/f5b8d0b58b57441bb3791e0ab7f4e374/AREA.sdat" -SLOPE "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/9131e41b1c7d4be1bd014561139573d6/SLOPE.sdat" -AREA_MOD "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/eaebd7ce670b4788930f1e05b18489f3/AREA_MOD.sdat" -TWI "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/2c01c35cd32b4b1fb88d22f6d31b3efd/TWI.sdat" C:\Users\Tyler\Documents>set SAGA=C:/OSGeo4W/apps\saga C:\Users\Tyler\Documents>set SAGA_MLB=C:/OSGeo4W/apps\saga\modules C:\Users\Tyler\Documents>PATH=C:\OSGeo4W\apps\qgis-ltr\bin;C:\OSGeo4W\apps\grass\grass83\lib;C:\OSGeo4W\apps\grass\grass83\bin;C:\OSGeo4W\apps\qt5\bin;C:\OSGeo4W\apps\Python39\Scripts;C:\OSGeo4W\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBem;C:/OSGeo4W/apps\saga;C:/OSGeo4W/apps\saga\modules C:\Users\Tyler\Documents>saga_cmd ta_hydrology "SAGA Wetness Index" -DEM "D:/rtesting/rqgis_trouble/dem.sgrd" -SUCTION 10.0 -AREA_TYPE 1 -SLOPE_TYPE 1 -SLOPE_MIN 0.0 -SLOPE_OFF 0.1 -SLOPE_WEIGHT 1.0 -AREA "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/f5b8d0b58b57441bb3791e0ab7f4e374/AREA.sdat" -SLOPE "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/9131e41b1c7d4be1bd014561139573d6/SLOPE.sdat" -AREA_MOD "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/eaebd7ce670b4788930f1e05b18489f3/AREA_MOD.sdat" -TWI "C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/2c01c35cd32b4b1fb88d22f6d31b3efd/TWI.sdat" ## ######## ### ## ## #### ###### ## ## ## ##### #SAGA Version: 7.8.2 (64 bit) library path: C:\OSGeo4W\apps\saga\tools Loading grid: D:/rtesting/rqgis_trouble/dem.sgrd... Parameters Grid System: 1; 117x 117y; 0x 0y pass 2 (0 > 0) Saving grid: C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/9131e41b1c7d4be1bd014561139573d6/SLOPE.sdat... Saving grid: C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/eaebd7ce670b4788930f1e05b18489f3/AREA_MOD.sdat... Saving grid: C:/Users/Tyler/AppData/Local/Temp/processing_MYVVIh/2c01c35cd32b4b1fb88d22f6d31b3efd/TWI.sdat... C:\Users\Tyler\Documents>exit Loading resulting layers |
OK, that is interesting and news to me. So thank you for sharing your solution! |
If it offers more confusion, the RSAGA package can successfully handle TIF as input file and writing to both TIF and SDAT files as output. I'm not sure if there's collaboration between the packages. I'm happy to answer any more questions if this is highlighting a problem with the most recent SAGA release? Successful Wetness Index Calculation with RSAGA (TIF and SDAT file formats)library(RSAGA)
#> Loading required package: gstat
#> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
#> which was just loaded, will retire in October 2023.
#> Please refer to R-spatial evolution reports for details, especially
#> https://r-spatial.org/r/2023/05/15/evolution4.html.
#> It may be desirable to make the sf package available;
#> package maintainers should consider adding sf to Suggests:.
#> The sp package is now running under evolution status 2
#> (status 2 uses the sf package in place of rgdal)
#> Loading required package: shapefiles
#> Loading required package: foreign
#>
#> Attaching package: 'shapefiles'
#> The following objects are masked from 'package:foreign':
#>
#> read.dbf, write.dbf
#> Loading required package: plyr
library(terra)
#> terra 1.7.39
unlink("twi*")
RSAGA::rsaga.wetness.index(
in.dem = system.file("raster","dem.tif",
package="spDataLarge"),
out.wetness.index = "twi.sdat"
)
#> Search for SAGA command line program and modules...
#> Done
#> Warning in rsaga.geoprocessor(lib = "ta_hydrology", module = "SAGA Wetness Index", : This RSAGA version has been tested with SAGA GIS versions between 2.3.1 and 8.4.1.
#> You seem to be using SAGA GIS 8.5.1, which may cause problems due to
#> possible changes in names and definitions of SAGA module arguments, etc.
#> Warning in rsaga.geoprocessor(lib, module = NULL, env = env, intern = TRUE, : This RSAGA version has been tested with SAGA GIS versions between 2.3.1 and 8.4.1.
#> You seem to be using SAGA GIS 8.5.1, which may cause problems due to
#> possible changes in names and definitions of SAGA module arguments, etc.
#>
#>
#> SAGA Version: 8.5.1 (64 bit)
#>
#> library path: C:\Progra~1\SAGA\tools\
#> library name: ta_hydrology
#> library : ta_hydrology
#> tool : SAGA Wetness Index
#> identifier : 15
#> author : J.Boehner, O.Conrad (c) 2001
#> processors : 12 [12]
#>
#> loading: dem
#> translation: dem
#> [SAGA Wetness Index] Execution started...
#>
#> [SAGA Wetness Index] Parameters:
#>
#> Grid System: 30.850000; 117x 117y; 794614.532615x 8931790.299603y
#> Elevation: dem
#> Weights: <not set>
#> Catchment Area: Catchment Area
#> Catchment Slope: Catchment Slope
#> Modified Catchment Area: Modified Catchment Area
#> Topographic Wetness Index: Topographic Wetness Index
#> Suction: 10
#> Type of Area: specific catchment area
#> Type of Slope: catchment slope
#> Minimum Slope: 0
#> Offset Slope: 0.1
#> Slope Weighting: 1
#>
#> Create index: dem
#> catchment area and slope...
#> pass 1 (917 > 0)
#> pass 2 (493 > 0)
#> pass 3 (253 > 0)
#> pass 4 (143 > 0)
#> pass 5 (65 > 0)
#> pass 6 (32 > 0)
#> pass 7 (5 > 0)
#> pass 8 (1 > 0)
#> pass 9 (0 > 0)
#> post-processing...
#> topographic wetness index...
#>
#> total execution time: 0 milliseconds (less than 1 millisecond)
#>
#> [SAGA Wetness Index] Execution succeeded (less than 1 millisecond)
#> Saving grid: C:\Users\Tyler\AppData\Local\Temp\RtmpeGuHQQ\file31ec14776bd3...
#> Saving grid: C:\Users\Tyler\AppData\Local\Temp\RtmpeGuHQQ\file31ec711824a9...
#> Saving grid: C:\Users\Tyler\AppData\Local\Temp\RtmpeGuHQQ\file31ec4f86f30...
#> Saving grid: twi.sdat...
"twi.sdat" %in% list.files()
#> [1] TRUE
OUTPUT = rast("twi.sdat")
plot(OUTPUT)
unlink("twi*")
RSAGA::rsaga.wetness.index(
in.dem = system.file("raster","dem.tif",
package="spDataLarge"),
out.wetness.index = "twi.tif"
)
#> Search for SAGA command line program and modules...
#> Done
#> Warning in rsaga.geoprocessor(lib = "ta_hydrology", module = "SAGA Wetness Index", : This RSAGA version has been tested with SAGA GIS versions between 2.3.1 and 8.4.1.
#> You seem to be using SAGA GIS 8.5.1, which may cause problems due to
#> possible changes in names and definitions of SAGA module arguments, etc.
#> Warning in rsaga.geoprocessor(lib = "ta_hydrology", module = "SAGA Wetness Index", : This RSAGA version has been tested with SAGA GIS versions between 2.3.1 and 8.4.1.
#> You seem to be using SAGA GIS 8.5.1, which may cause problems due to
#> possible changes in names and definitions of SAGA module arguments, etc.
#>
#>
#> SAGA Version: 8.5.1 (64 bit)
#>
#> library path: C:\Progra~1\SAGA\tools\
#> library name: ta_hydrology
#> library : ta_hydrology
#> tool : SAGA Wetness Index
#> identifier : 15
#> author : J.Boehner, O.Conrad (c) 2001
#> processors : 12 [12]
#>
#> loading: dem
#> translation: dem
#> [SAGA Wetness Index] Execution started...
#>
#> [SAGA Wetness Index] Parameters:
#>
#> Grid System: 30.850000; 117x 117y; 794614.532615x 8931790.299603y
#> Elevation: dem
#> Weights: <not set>
#> Catchment Area: Catchment Area
#> Catchment Slope: Catchment Slope
#> Modified Catchment Area: Modified Catchment Area
#> Topographic Wetness Index: Topographic Wetness Index
#> Suction: 10
#> Type of Area: specific catchment area
#> Type of Slope: catchment slope
#> Minimum Slope: 0
#> Offset Slope: 0.1
#> Slope Weighting: 1
#>
#> Create index: dem
#> catchment area and slope...
#> pass 1 (981 > 0)
#> pass 2 (524 > 0)
#> pass 3 (268 > 0)
#> pass 4 (142 > 0)
#> pass 5 (71 > 0)
#> pass 6 (33 > 0)
#> pass 7 (5 > 0)
#> pass 8 (1 > 0)
#> pass 9 (0 > 0)
#> post-processing...
#> topographic wetness index...
#>
#> total execution time: 0 milliseconds (less than 1 millisecond)
#>
#> [SAGA Wetness Index] Execution succeeded (less than 1 millisecond)
#> Saving grid: C:\Users\Tyler\AppData\Local\Temp\RtmpeGuHQQ\file31ec1c9e2784...
#> Saving grid: C:\Users\Tyler\AppData\Local\Temp\RtmpeGuHQQ\file31ec63f7731a...
#> Saving grid: C:\Users\Tyler\AppData\Local\Temp\RtmpeGuHQQ\file31ec246a2fc2...
#> Saving grid: twi.tif...
#> Export GeoTIFF
#>
#> [Export GeoTIFF] Parameters:
#>
#> Grid System: 30.850000; 117x 117y; 794614.532615x 8931790.299603y
#> Grid(s): 1 object (twi)
#> File: twi.tif
#> Creation Options: COMPRESS=LZW
#>
#> Band 1
#>
#> [Export GeoTIFF] execution time: less than 1 millisecond
"twi.tif" %in% list.files()
#> [1] TRUE
OUTPUT = rast("twi.tif")
plot(OUTPUT) Created on 2023-07-12 with reprex v2.0.2 Session infosessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.1 (2023-06-16 ucrt)
#> os Windows 10 x64 (build 19045)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_Canada.utf8
#> ctype English_Canada.utf8
#> tz America/Toronto
#> date 2023-07-12
#> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> ! package * version date (UTC) lib source
#> cli 3.6.1 2023-03-23 [1] CRAN (R 4.2.3)
#> codetools 0.2-19 2023-02-01 [2] CRAN (R 4.3.1)
#> curl 5.0.1 2023-06-07 [1] CRAN (R 4.3.1)
#> digest 0.6.32 2023-06-26 [1] CRAN (R 4.3.1)
#> evaluate 0.21 2023-05-05 [1] CRAN (R 4.2.3)
#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.2.3)
#> FNN 1.1.3.2 2023-03-20 [1] CRAN (R 4.2.3)
#> foreign * 0.8-84 2022-12-06 [1] CRAN (R 4.2.2)
#> fs 1.6.2 2023-04-25 [1] CRAN (R 4.2.3)
#> D glue 1.6.2 2022-02-24 [1] CRAN (R 4.2.0)
#> gstat * 2.1-1 2023-04-06 [1] CRAN (R 4.2.3)
#> highr 0.10 2022-12-22 [1] CRAN (R 4.2.2)
#> htmltools 0.5.5 2023-03-23 [1] CRAN (R 4.2.3)
#> intervals 0.15.4 2023-06-29 [1] CRAN (R 4.3.1)
#> knitr 1.43 2023-05-25 [1] CRAN (R 4.2.3)
#> lattice 0.21-8 2023-04-05 [1] CRAN (R 4.2.3)
#> lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.2.2)
#> D magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.0)
#> plyr * 1.8.8 2022-11-11 [1] CRAN (R 4.2.2)
#> Rcpp 1.0.11 2023-07-06 [1] CRAN (R 4.3.1)
#> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.2.1)
#> rlang 1.1.1 2023-04-28 [1] CRAN (R 4.2.3)
#> rmarkdown 2.23 2023-07-01 [1] CRAN (R 4.3.1)
#> RSAGA * 1.4.0 2022-12-09 [1] CRAN (R 4.3.1)
#> rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.2.1)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.1.3)
#> shapefiles * 0.7.2 2022-08-25 [1] CRAN (R 4.2.1)
#> sp 2.0-0 2023-06-22 [1] CRAN (R 4.3.1)
#> spacetime 1.3-0 2023-04-05 [1] CRAN (R 4.2.3)
#> terra * 1.7-39 2023-06-23 [1] CRAN (R 4.3.1)
#> withr 2.5.0 2022-03-03 [1] CRAN (R 4.2.0)
#> xfun 0.39 2023-04-20 [1] CRAN (R 4.2.3)
#> xml2 1.3.4 2023-04-27 [1] CRAN (R 4.2.3)
#> xts 0.13.1 2023-04-16 [1] CRAN (R 4.2.3)
#> yaml 2.3.7 2023-01-23 [1] CRAN (R 4.2.3)
#> zoo 1.8-12 2023-04-13 [1] CRAN (R 4.2.3)
#>
#> [1] C:/Users/Tyler/AppData/Local/R/win-library/4.3
#> [2] C:/Program Files/R/R-4.3.1/library
#>
#> D ── DLL MD5 mismatch, broken installation.
#>
#> ────────────────────────────────────────────────────────────────────────────── |
Interesting, indeed. By the way there is also a Rsagacmd package and if this package also can handle tif inputs, this would potentially mean that there is a bug with the way QGIS handles the SAGA API. |
Thanks a lot @tylerbhampton for these experiments both in R and QGIS! I believe the SAGA version is the cause here, I don't think QGIS itself nor the SAGA Next Gen provider is at stake:
The QGIS solution that does not need the
Also note that the native SAGA provider in QGIS has been dropped since QGIS 3.30. |
If you can let us know whether the SAGANG 'SAGA folder' setting fixes this, that would be a great confirmation @tylerbhampton ! Your SAGA 8.5.1 standalone installation is in |
Thanks @tylerbhampton; are you sure that you can also not click or double click in the white area right to SAGA folder and type a path? I could not find some logic in the plugin code that prevents editing in the case of OSGEO4W, so if that does not work it might be a bug, to be reported at https://github.com/north-road/qgis-processing-saga-nextgen |
#166 (comment) has the analysis of this problem – it depends on the SAGA version – and provides ways forward. Closing this issue as this implies no work in qgisprocess. |
@ambarja @florisvdh
I'm referencing the example from the cheatsheets. I'm unable to get qgisprocess to produce any outputs from raster analysis. I have been successful in reproducing the buffer vector analysis in the README. First, there are some correction s from the cheatsheet, as the topographic wetness index is TWI not TPI. I'm unable to see a file written from the analysis.
I'm hoping to perform analysis with SAGA Fill Sinks, but this example from the cheatsheet and a SAGA function is a good place to start with my issue.
`> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 3.1
year 2023
month 06
day 16
svn rev 84548
language R
version.string R version 4.3.1 (2023-06-16 ucrt)
nickname Beagle Scouts
Description
Arguments
DEM: Elevation
Argument type: raster
Acceptable values:
- Path to a raster layer
WEIGHT: Weights (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
AREA: Catchment Area
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
SLOPE: Catchment Slope
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
AREA_MOD: Modified Catchment Area
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
TWI: Topographic Wetness Index
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
SUCTION: Suction
Default value: 10
Argument type: number
Acceptable values:
- A numeric value
AREA_TYPE: Type of Area
Default value: 1
Argument type: enum
Available values:
- 0: [0] total catchment area
- 1: [1] square root of catchment area
- 2: [2] specific catchment area
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
SLOPE_TYPE: Type of Slope
Default value: 1
Argument type: enum
Available values:
- 0: [0] local slope
- 1: [1] catchment slope
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
SLOPE_MIN: Minimum Slope
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
SLOPE_OFF: Offset Slope
Default value: 0.1
Argument type: number
Acceptable values:
- A numeric value
SLOPE_WEIGHT: Slope Weighting
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
Outputs
AREA:
Catchment Area
SLOPE:
Catchment Slope
AREA_MOD:
Modified Catchment Area
TWI:
Topographic Wetness Index
Argument
WEIGHT
is unspecified (using QGIS default value).Using
AREA = qgis_tmp_raster()
Using
SLOPE = qgis_tmp_raster()
Using
AREA_MOD = qgis_tmp_raster()
Argument
SUCTION
is unspecified (using QGIS default value).Using
AREA_TYPE = "[0] total catchment area"
Using
SLOPE_TYPE = "[0] local slope"
Argument
SLOPE_MIN
is unspecified (using QGIS default value).Argument
SLOPE_OFF
is unspecified (using QGIS default value).Argument
SLOPE_WEIGHT
is unspecified (using QGIS default value).The text was updated successfully, but these errors were encountered: