r-spatial / RQGIS3

GNU Lesser General Public License v3.0
69 stars 19 forks source link

Failed to locate grass7 #13

Closed ErvanCH closed 4 years ago

ErvanCH commented 4 years ago

Hi there,

Thanks for all your work to develop this very nice package. I have updated QGIS to version 3.8, and it seems RQGIS3 can't locate grass7 and subsequent functions. Here is what I get:

library(RQGIS3)

set_env() Trying to find QGIS in C:/ $root [1] "C:/Program Files/QGIS 3.8"

$qgis_prefix_path [1] "C:/Program Files/QGIS 3.8/apps/qgis"

$python_plugins [1] "C:/Program Files/QGIS 3.8/apps/qgis/python/plugins"

info_r <- version info_qgis <- qgis_session_info() ERROR 4: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files. c(platform = info_r$platform, R = info_r$version.string, info_qgis) $platform [1] "x86_64-w64-mingw32"

$R [1] "R version 3.5.2 (2018-12-20)"

$gdal [1] "2.4.1"

$grass7 [1] FALSE

$qgis_version [1] "3.8.0-Zanzibar"

$saga [1] "2.3.2"

find_algorithms(search_term = "curvature",name_only = TRUE) [1] "saga:curvatureclassification" "saga:slopeaspectcurvature" "saga:upslopeanddownslopecurvature"

Am I doing anything wrong? Many thanks for your guidance. Ervan

jannes-m commented 4 years ago

qgis_session_info() does not report if GRASS7 is installed, afair this is a QGIS3 issue. However, GRASS7 algorithms can be run, e.g., I just ran following code under Windows using the latest QGIS3 version (3.8.0).

library("RQGIS3")
library("raster")
# attach data
data("dem")
params = get_args_man(alg = "grass7:r.slope.aspect", options = TRUE)
params$elevation = dem
params$slope = file.path(tempdir(), "slope.tif")
params$aspect = file.path(tempdir(), "aspect.tif")
grass_out_1 = run_qgis(
    "grass7:r.slope.aspect", params = params,
    show_output_paths = FALSE, load_output = TRUE
)

In any case, make sure that your OSGeo4W installer also installed GRASS7.