diff --git a/R/AAAA.R b/R/AAAA.R index 4ed0608..73db8a9 100644 --- a/R/AAAA.R +++ b/R/AAAA.R @@ -107,7 +107,12 @@ paths <- function(gdalwarp = "", gdal_translate = "", convert = "", saga_cmd = " if(!is.null(x[[1]]$path)){ gdalwarp = shQuote(utils::shortPathName(normalizePath(file.path(x[[1]]$path, "gdalwarp.exe")))) gdal_translate = shQuote(utils::shortPathName(normalizePath(file.path(x[[1]]$path, "gdal_translate.exe")))) - }} else { + }} else if (grepl("QGIS",Sys.getenv("PATH"),ignore.case=TRUE)) { + p <- unlist(strsplit(Sys.getenv("PATH"),.Platform$path.sep)) + qgis <- grep("QGIS",p,ignore.case,value=TRUE)[[1]] + gdalwarp <- normalizePath(file.path(qgis,'gdalwarp.exe')) + gdal_translate <- normalizePath(file.path(qgis,'gdal_translate.exe')) + } else { warning("Could not locate GDAL! Install program and add it to the Windows registry. See http://www.gdal.org/ for more info.") gdalwarp = "" gdal_translate = ""