Skip to content

Commit

Permalink
minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gisma committed Jun 7, 2024
1 parent b8e1e9d commit c2a908f
Show file tree
Hide file tree
Showing 42 changed files with 72 additions and 96 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: link2GI
Type: Package
Title: Linking Geographic Information Systems, Remote Sensing and Other Command Line Tools
Version: 0.6-1
Date: 2024-05-03
Version: 0.6-2
Date: 2024-06-07
Authors@R: c(person("Chris", "Reudenbach", email = "[email protected]", role = c("cre", "aut")),
person("Tim", "Appelhans", email = "[email protected]>", role = c("ctb"))
)
Encoding: UTF-8
Maintainer: Chris Reudenbach <[email protected]>
Description: Functions for straightforward use of open GIS and remote sensing command line interfaces in a reproducible project environment.
Description: Functions and tools for using open GIS and remote sensing command-line interfaces in a reproducible environment.
URL: https://github.com/r-spatial/link2GI/, https://r-spatial.github.io/link2GI/
BugReports: https://github.com/r-spatial/link2GI/issues/
License: GPL (>= 3) | file LICENSE
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ bugfixes:

new feature:

* add manual build function for UNC pathes
* add manual build function for UNC paths

bugfixes:

Expand Down Expand Up @@ -244,7 +244,7 @@ new feature:
* remove all global variables (re-opened #3)
* homogenization of the link calls
* wrap searchAPIOS functions with OS-agnostic findAPI functions
* add a more robust return of all pathes and environmental variables as lists
* add a more robust return of all paths and environmental variables as lists
* add a quiet option to supress all! console outputs ( #4)

bugfixes:
Expand Down
4 changes: 2 additions & 2 deletions R/gdalControls.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#'@description Initializes and set up access to the 'GDAL' command line interface
#'
#'@param bin_GDAL string contains the path to the 'GDAL' binaries
#'@return Adds 'GDAL' pathes to the environment and creates the variable global string variable \code{gdalCmd}, that contains the path to the 'GDAL' binaries.
#'@return Adds 'GDAL' paths to the environment and creates the variable global string variable \code{gdalCmd}, that contains the path to the 'GDAL' binaries.
#'@keywords internal
#'
#'@examples
Expand All @@ -15,7 +15,7 @@
#' root_GDAL = 'C:/OSGeo4W64')
#'}
setenvGDAL <- function(bin_GDAL = NULL) {
# (R) set pathes of gdal modules and binaries depending on OS
# (R) set paths of gdal modules and binaries depending on OS
if (Sys.info()["sysname"] == "Windows") {
if (!exists("GiEnv"))
GiEnv <- new.env(parent = globalenv())
Expand Down
6 changes: 3 additions & 3 deletions R/grassControl.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ paramGRASSx <- function(set_default_GRASS = NULL, MP = "/usr/bin", ver_select =
ver_select <- FALSE
if (Sys.info()["sysname"] == "Windows")
return(cat("You are running Windows - Please choose a suitable searchLocation argument that MUST include a Windows drive letter and colon"))
# iF WE KNOW NOTHING ABOUT grass PATHES WE HAVE TO SEARCH
# iF WE KNOW NOTHING ABOUT grass PATHS WE HAVE TO SEARCH
if (is.null(set_default_GRASS)) {
# SEARCH FOR INSTALLATIONS
params_GRASS <- findGRASS(searchLocation = MP)
Expand Down Expand Up @@ -92,7 +92,7 @@ paramGRASSx <- function(set_default_GRASS = NULL, MP = "/usr/bin", ver_select =
#'@param DL character search location default = \code{C:}
#'@param ver_select boolean default is FALSE. If there is more than one 'SAGA GIS' installation and \code{ver_select} = TRUE the user can select interactively the preferred 'SAGA GIS' version
#'@param set_default_GRASS default = NULL forces a full search for 'GRASS GIS' binaries. You may
#' alternatively provide a vector containing pathes and keywords. c('C:/OSGeo4W64','grass-7.0.5','osgeo4w') is valid for a typical osgeo4w installation.
#' alternatively provide a vector containing paths and keywords. c('C:/OSGeo4W64','grass-7.0.5','osgeo4w') is valid for a typical osgeo4w installation.
#'
#'@param quiet boolean switch for supressing console messages default is TRUE
#'@keywords internal
Expand All @@ -115,7 +115,7 @@ paramGRASSw <- function(set_default_GRASS = NULL, DL = "C:/", ver_select = FALSE
ver_select <- FALSE
if (Sys.info()["sysname"] == "Linux")
return(cat("You are running Linux - please choose a suitable searchLocation argument"))
# (R) set pathes of 'GRASS' binaries depending on 'WINDOWS'
# (R) set paths of 'GRASS' binaries depending on 'WINDOWS'
if (is.null(set_default_GRASS)) {
if (DL == "default" || is.null(DL))
DL <- "C:/"
Expand Down
7 changes: 3 additions & 4 deletions R/initProj.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ createFolders <- function(root_folder, folders, create_folders = TRUE) {
#' this variable to load/save data to avoid any hard coded links in the scripts except the top-level root folder which
#' is defined once in the main control script located at src/main.R.
#'
#' @return dirs, i.e. a list containing the project pathes.
#' @return dirs, i.e. a list containing the project paths.
#'
#' @name initProj
#'
Expand Down Expand Up @@ -182,11 +182,10 @@ initProj <- function(root_folder = ".", folders = NULL, init_git = NULL, init_re
libs = libs, standard_setup = NULL)
}
# create R project and scripts
brew::brew(system.file(sprintf("templates/%s.brew", "rstudio_proj"), package = "link2GI"), file.path(root_folder, paste0(basename(root_folder),
".Rproj")))
brew::brew(system.file(sprintf("templates/%s.brew", "rstudio_proj"), package = "link2GI"), file.path(root_folder, paste0(basename(root_folder), ".Rproj")))
brew::brew(system.file(sprintf("templates/%s.brew", "script_control"), package = "link2GI"), file.path(dirs$src, "main-control.R"))
brew::brew(system.file(sprintf("templates/%s.brew", "pre-processing"), package = "link2GI"), file.path(dirs$src, "pre-processing.R"))
brew::brew(system.file(sprintf("templates/%s.brew", "processing"), package = "link2GI"), file.path(dirs$src, "10-processing.R"))
brew::brew(system.file(sprintf("templates/%s.brew", "processing"), package = "link2GI"), file.path(dirs$src, "processing.R"))
brew::brew(system.file(sprintf("templates/%s.brew", "post-processing"), package = "link2GI"), file.path(dirs$src, "post-processing.R"))
brew::brew(system.file(sprintf("templates/%s.brew", "config-master-yml"), package = "link2GI"), file.path(dirs$config,
"config-master.yml"))
Expand Down
4 changes: 2 additions & 2 deletions R/linkGDAL.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (!isGeneric("linkGDAL")) {
#'
#'@note You may also set the path manually. Using a 'OSGeo4W64' \url{https://trac.osgeo.org/osgeo4w/} installation it is typically \code{C:/OSGeo4W64/bin/}
#'@author Chris Reudenbach
#'@return add gdal pathes to the environment and creates global variables path_GDAL
#'@return add gdal paths to the environment and creates global variables path_GDAL
#'@details if called without any parameter \code{linkGDAL()} it performs a full search over the hard drive \code{C:}. If it finds one or more 'GDAL' binaries it will take the first hit. You have to set \code{ver_select = TRUE} for an interactive selection of the preferred version.
#'@export linkGDAL
#'
Expand Down Expand Up @@ -89,7 +89,7 @@ linkGDAL <- function(bin_GDAL = NULL, searchLocation = NULL, ver_select = FALSE,
gdal$py <- params_GDAL[[3]][ver]
gdal$exist <- TRUE
}
# (R) set pathes of GDAL binaries depending on OS WINDOWS }
# (R) set paths of GDAL binaries depending on OS WINDOWS }
# else { # if (is.null(searchLocation)) searchLocation<-'C:/' # params_GDAL <- findGDAL(searchLocation =
# searchLocation,quiet = quiet) #if ( params_GDAL != FALSE) if (nrow(params_GDAL$gdalInstallations) == 1) {
# pathGDAL <- setenvGDAL(bin_GDAL =params_GDAL$gdalInstallations[[1]][1]) # if more than one valid installation
Expand Down
2 changes: 1 addition & 1 deletion R/linkGRASS.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (!isGeneric("linkGRASS")) {
#'@param epsg manual epsg override
#'@param ver_select Boolean if TRUE you may choose interactively the binary version (if found more than one), by default FALSE
#'@param quiet Boolean switch for suppressing console messages default is TRUE
#'@param returnPaths Boolean if set to FALSE the pathes of the selected version are written
#'@param returnPaths Boolean if set to FALSE the paths of the selected version are written
#' to the PATH variable only, otherwise all paths and versions of the installed GRASS versions ae returned.
#'@author Chris Reudenbach
#'@export linkGRASS
Expand Down
2 changes: 1 addition & 1 deletion R/linkOTB.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ linkOTB <- function(bin_OTB = NULL, root_OTB = NULL, type_OTB = NULL, searchLoca
otbCmd <- params_OTB$otbCmd[[ver]]
}
}
#### (R) set pathes of OTB binaries depending on OS WINDOWS ###
#### (R) set paths of OTB binaries depending on OS WINDOWS ###
} else {
if (nrow(params_OTB) == 1) {
pathOTB <- setenvOTB(bin_OTB = params_OTB$binDir[1], root_OTB = params_OTB$baseDir[2])
Expand Down
6 changes: 3 additions & 3 deletions R/linkSAGA.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if ( !isGeneric("linkSAGA") ) {
#' is \code{C:}, for Linux systems default is \code{/usr/bin}.
#'@param ver_select boolean default is FALSE. If there is more than one 'SAGA GIS' installation and \code{ver_select} = TRUE the user can select interactively the preferred 'SAGA GIS' version
#'@param quiet boolean switch for supressing console messages default is TRUE
#'@param returnPaths boolean if set to FALSE the pathes of the selected version are written
#' to the PATH variable only, otherwise all paths and versions of the installed SAGA versions ae returned.#'@details If called without any parameter \code{linkSAGA()} it performs a full search over \code{C:}. If it finds one or more 'SAGA GIS' binaries it will take the first hit. You have to set \code{ver_select = TRUE} for an interactive selection of the preferred version. Additionally the selected SAGA pathes are added to the environment and the global variables \code{sagaPath}, \code{sagaModPath} and \code{sagaCmd} will be created.
#'@param returnPaths boolean if set to FALSE the paths of the selected version are written
#' to the PATH variable only, otherwise all paths and versions of the installed SAGA versions ae returned.#'@details If called without any parameter \code{linkSAGA()} it performs a full search over \code{C:}. If it finds one or more 'SAGA GIS' binaries it will take the first hit. You have to set \code{ver_select = TRUE} for an interactive selection of the preferred version. Additionally the selected SAGA paths are added to the environment and the global variables \code{sagaPath}, \code{sagaModPath} and \code{sagaCmd} will be created.

#'@export linkSAGA
#'
Expand All @@ -51,7 +51,7 @@ linkSAGA <- function(default_SAGA = NULL,
ver_select=FALSE,
quiet = TRUE,
returnPaths = TRUE){
# (R) set pathes of SAGA modules and binaries depending on OS
# (R) set paths of SAGA modules and binaries depending on OS
exist <- FALSE
if (ver_select =='T') ver_select <- TRUE
if (ver_select == "F" && !is.numeric(ver_select)) ver_select <- FALSE
Expand Down
4 changes: 2 additions & 2 deletions R/otbControls.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'@param bin_OTB string contains the path to the 'OTB' binaries
#'@param root_OTB string contains the full string to the root folder
#' containing the 'OTB' installation'
#'@return Adds 'OTB' pathes to the environment and creates the variable global string variable \code{otbCmd}, that contains the path to the 'OTB' binaries.
#'@return Adds 'OTB' paths to the environment and creates the variable global string variable \code{otbCmd}, that contains the path to the 'OTB' binaries.
#'@keywords internal
#'
#'@examples
Expand All @@ -15,7 +15,7 @@
#' root_OTB = 'C:\\OSGeo4W64')
#'}
setenvOTB <- function(bin_OTB = NULL, root_OTB = NULL) {
# (R) set pathes of otb modules and binaries depending on OS
# (R) set paths of otb modules and binaries depending on OS
if (Sys.info()["sysname"] == "Windows") {
if (!exists("GiEnv"))
GiEnv <- new.env(parent = globalenv())
Expand Down
2 changes: 1 addition & 1 deletion docs/articles/link2GI1.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/link2GI2.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/link2GI3.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/link2GI4.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/link2GI5.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/link2GI6.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/link2GI7.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ articles:
link2GI5: link2GI5.html
link2GI6: link2GI6.html
link2GI7: link2GI7.html
last_built: 2024-06-01T13:55Z
last_built: 2024-06-07T10:29Z
urls:
reference: https://r-spatial.github.io/link2GI/reference
article: https://r-spatial.github.io/link2GI/articles
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/initProj.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/linkGDAL.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c2a908f

Please sign in to comment.