Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarified documentation for prepInputs and postProcess #385

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions R/postProcessTo.R
Original file line number Diff line number Diff line change
Expand Up @@ -666,21 +666,18 @@ projectTo <- function(from, projectTo, overwrite = FALSE,
if (!terra::is.lonlat(from)) {
# if (sf::st_crs("epsg:4326") != sf::st_crs(from)) {
newRes <- terra::res(from)
messagePreProcess("Using resolution of ", paste(newRes, collapse = "x"), "m; ",
messagePreProcess("Using original resolution (", paste(newRes, collapse = "x"), "m) ",
verbose = verbose
)
projectTo <- terra::rast(projectTo, resolution = newRes)
} else {
projectTo <- terra::crs(projectTo)
}

messagePreProcess("in the projection of `projectTo`, using the origin and extent",
messagePreProcess("Using the origin and extent from `ext(from)` in the projection from `crs(projectTo)`.",
verbose = verbose
)
messagePreProcess("from `ext(from)` (in the projection from `projectTo`).",
verbose = verbose
)
messagePreProcess("If this is not correct, create a template gridded object and pass that to projectTo...",
messagePreProcess("If this is not correct, create a template gridded object and pass that to `projectTo`...",
verbose = verbose
)
messagePreProcess("",
Expand Down Expand Up @@ -758,7 +755,7 @@ projectTo <- function(from, projectTo, overwrite = FALSE,
from
}

#' @param needBuffer Logical. Defaults to `TRUE`, meaning nothing is done out
#' @param needBuffer Logical. Defaults to `FALSE`, meaning nothing is done out
#' of the ordinary. If `TRUE`, then a buffer around the cropTo, so that if a reprojection
#' has to happen on the `cropTo` prior to using it as a crop layer, then a buffer
#' of 1.5 * res(cropTo) will occur prior, so that no edges are cut off.
Expand Down
8 changes: 5 additions & 3 deletions R/prepInputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ utils::globalVariables(c(
#' Defaults to `getOption("reproducible.useCache", 2L)` in `prepInputs`, and
#' `getOption("reproducible.useCache", FALSE)` if calling any of the inner
#' functions manually. For `prepInputs`, this mean it will use `Cache`
#' only up to 2 nested levels, which will generally including `postProcess` and
#' the first level of `*Input` functions, e.g., `cropInputs`, `projectInputs`,
#' `maskInputs`, but not `fixErrors`.
#' only up to 2 nested levels, which includes `preProcess`. `postProcess` and
#' its nested `*Input` functions (e.g., `cropInputs`, `projectInputs`,
#' `maskInputs`) are no longer internally cached, as `terra` processing speeds
#' mean internal caching is more time consuming. We recommend caching the full
#' `prepInputs` call instead (e.g. `prepInputs(...) |> Cache()`).
#'
#' @param .tempPath Optional temporary path for internal file intermediate steps.
#' Will be cleared on.exit from this function.
Expand Down
8 changes: 5 additions & 3 deletions man/CacheGeo.Rd

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

2 changes: 1 addition & 1 deletion man/checkPath.Rd

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

2 changes: 1 addition & 1 deletion man/normPath.Rd

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

2 changes: 1 addition & 1 deletion man/postProcessTo.Rd

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

8 changes: 5 additions & 3 deletions man/prepInputs.Rd

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

2 changes: 1 addition & 1 deletion man/robustDigest.Rd

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