Skip to content
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

Cannot Pass R Object to GRASS functions #25

Open
ailich opened this issue Jul 15, 2020 · 0 comments
Open

Cannot Pass R Object to GRASS functions #25

ailich opened this issue Jul 15, 2020 · 0 comments

Comments

@ailich
Copy link

ailich commented Jul 15, 2020

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/...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant