Skip to content

Commit

Permalink
update docs; use CPL_TMPDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
appelmar committed Feb 29, 2024
1 parent 46149bf commit 714682c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
^gdalcubes.log$
^.bash_history$
^.vscode$
^src/gdalcubes/.vscode$
^README.html$
^inst/gdal$
^inst/proj$
4 changes: 2 additions & 2 deletions R/extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions R/window.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
1 change: 1 addition & 0 deletions inst/scripts/worker.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

8 changes: 4 additions & 4 deletions man/extract_geom.Rd

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

5 changes: 3 additions & 2 deletions man/window_space.Rd

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

0 comments on commit 714682c

Please sign in to comment.