Cannot Pass R Object to GRASS functions
ailich opened this issue · 0 comments
ailich commented
Previously I was able to pass R objects to run_qgis when using GRASS functions, but after updating R/packages it now only works when the path is specified (R version 3.6.3; RQGIS3 1.0.1.9000; raster 3.3.7).
#Load Packages and Setup
library(raster)
library(RQGIS3)
set_env()
# Trying to find QGIS in C:/OSGEO4~1
# $root
# [1] "C:/OSGeo4W64"
#
# $qgis_prefix_path
# [1] "C:/OSGeo4W64/apps/qgis"
#
# $python_plugins
# [1] "C:/OSGeo4W64/apps/qgis/python/plugins"
#
# $platform
# [1] "Windows"
open_app()
qgis_session_info()
# $gdal
# [1] "2.4.1"
#
# $grass7
# [1] FALSE
#
# $qgis_version
# [1] "3.10.0-A Coruña"
#
# $saga
# [1] "2.3.2"
#Load Data
writeRaster(raster(volcano), "volcano.tif")
r<- raster("volcano.tif")
#With R object
params1<- get_args_man("grass7:r.neighbors")
params1$input<- r
params1$output<- "out1.tif"
out1<- run_qgis(alg = "grass7:r.neighbors",
params = params1, load_output = TRUE)
# Error in crs != "" :
# comparison (2) is possible only for atomic and list types
# In addition: Warning message:
# In .gd_SetProject(object, ...) : NOT UPDATED FOR PROJ >= 6
#With filepath
params2<- get_args_man("grass7:r.neighbors")
params2$input<- "volcano.tif"
params2$output<- "out2.tif"
out2<- run_qgis(alg = "grass7:r.neighbors",
params = params2, load_output = TRUE) #Works
#$output
#[1] "C:/Users/...