diff --git a/.Rbuildignore b/.Rbuildignore index e44b4cb..fa914e0 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -87,6 +87,7 @@ ^gdalcubes.log$ ^.bash_history$ ^.vscode$ +^src/gdalcubes/.vscode$ ^README.html$ ^inst/gdal$ ^inst/proj$ \ No newline at end of file diff --git a/R/extract.R b/R/extract.R index a50bff1..4334816 100644 --- a/R/extract.R +++ b/R/extract.R @@ -12,8 +12,8 @@ #' @param FUN optional function to compute per feature summary statistics #' @param ... additional arguments passed to \code{FUN} #' @param reduce_time logical; if TRUE, time is ignored when \code{FUN} is applied -#' @param merge; logical; return a combined data.frame with data cube values and labels, defaults to FALSE -#' @param drop_geom; remove geometries from output, only applicable if merge is TRUE, defaults to FALSE +#' @param merge logical; return a combined data.frame with data cube values and labels, defaults to FALSE +#' @param drop_geom logical; remove geometries from output, only used if merge is TRUE, defaults to FALSE #' @return A data.frame with columns FID, time, and data cube bands / variables, see Details #' @details #' The geometry in \code{sf} can be of any simple feature type supported by GDAL, including diff --git a/R/window.R b/R/window.R index ea57535..fb4ec6a 100644 --- a/R/window.R +++ b/R/window.R @@ -131,7 +131,7 @@ is.window_time_cube <- function(obj) { #' @param ... optional additional expressions (if expr is not a vector) #' @return proxy data cube object #' @note Implemented reducers will ignore any NAN values (as \code{na.rm = TRUE} does). -#' @note THIS FUNCTION IS STILL EXPERIMENTAL. +#' @note Calling this function consecutively many times may result in long computation times depending on chunk and window sizes due to the need to read adjacent data cube chunks. #' @examples #' # create image collection from example Landsat data only #' # if not already done in other examples @@ -150,7 +150,8 @@ is.window_time_cube <- function(obj) { #' L8.cube.mean5x5 = window_space(L8.cube, kernel = matrix(1/25, 5, 5)) #' L8.cube.mean5x5 #' -#' L8.cube.med_sd = window_space(L8.cube, "median(B04)" ,"sd(B04)", "median(B05)", "sd(B05)", window = c(5,5), keep_bands = TRUE) +#' L8.cube.med_sd = window_space(L8.cube, "median(B04)" ,"sd(B04)", "median(B05)", "sd(B05)", +#' window = c(5,5), keep_bands = TRUE) #' L8.cube.med_sd #' #' @note This function returns a proxy object, i.e., it will not start any computations besides deriving the shape of the result. diff --git a/R/zzz.R b/R/zzz.R index 9cb9af9..d6786d1 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -50,6 +50,7 @@ if (dir.exists(system.file("gdal", package="gdalcubes"))) { Sys.setenv("GDAL_DATA" = system.file("gdal", package="gdalcubes")) } + gdalcubes_set_gdal_config("CPL_TMPDIR", tempdir()) invisible() } diff --git a/inst/scripts/worker.R b/inst/scripts/worker.R index a59efb7..e35dced 100644 --- a/inst/scripts/worker.R +++ b/inst/scripts/worker.R @@ -25,6 +25,7 @@ if (!is.null(gdal_options)) { gdalcubes_set_gdal_config(key, gdal_options[key]) } } +gdalcubes_set_gdal_config("CPL_TMPDIR", tempdir()) # use separate dirs for temporary files gdalcubes:::gc_exec_worker(j$cube, j$worker_id, j$worker_count, j$workdir, gdalcubes_options()$ncdf_compression_level) \ No newline at end of file diff --git a/man/extract_geom.Rd b/man/extract_geom.Rd index 6b9e07d..78c9113 100644 --- a/man/extract_geom.Rd +++ b/man/extract_geom.Rd @@ -27,13 +27,13 @@ extract_geom( \item{FUN}{optional function to compute per feature summary statistics} -\item{...}{additional arguments passed to \code{FUN}} +\item{merge}{logical; return a combined data.frame with data cube values and labels, defaults to FALSE} -\item{reduce_time}{logical; if TRUE, time is ignored when \code{FUN} is applied} +\item{drop_geom}{logical; remove geometries from output, only used if merge is TRUE, defaults to FALSE} -\item{merge;}{logical; return a combined data.frame with data cube values and labels, defaults to FALSE} +\item{...}{additional arguments passed to \code{FUN}} -\item{drop_geom;}{remove geometries from output, only applicable if merge is TRUE, defaults to FALSE} +\item{reduce_time}{logical; if TRUE, time is ignored when \code{FUN} is applied} } \value{ A data.frame with columns FID, time, and data cube bands / variables, see Details diff --git a/man/window_space.Rd b/man/window_space.Rd index 1a0f3e9..e0e3919 100644 --- a/man/window_space.Rd +++ b/man/window_space.Rd @@ -43,7 +43,7 @@ more complex functions or arguments. Possible reducers currently include "min", \note{ Implemented reducers will ignore any NAN values (as \code{na.rm = TRUE} does). -THIS FUNCTION IS STILL EXPERIMENTAL. +Calling this function consecutively many times may result in long computation times depending on chunk and window sizes due to the need to read adjacent data cube chunks. This function returns a proxy object, i.e., it will not start any computations besides deriving the shape of the result. } @@ -65,7 +65,8 @@ L8.cube = select_bands(L8.cube, c("B04", "B05")) L8.cube.mean5x5 = window_space(L8.cube, kernel = matrix(1/25, 5, 5)) L8.cube.mean5x5 -L8.cube.med_sd = window_space(L8.cube, "median(B04)" ,"sd(B04)", "median(B05)", "sd(B05)", window = c(5,5), keep_bands = TRUE) +L8.cube.med_sd = window_space(L8.cube, "median(B04)" ,"sd(B04)", "median(B05)", "sd(B05)", + window = c(5,5), keep_bands = TRUE) L8.cube.med_sd }