Skip to content

Commit

Permalink
Merge pull request #150 from njtierney/reuse-documentation-i149
Browse files Browse the repository at this point in the history
reuse documentation - resolve #149
  • Loading branch information
njtierney authored Jan 20, 2025
2 parents be38c14 + d3700c9 commit 919a36e
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 30 deletions.
19 changes: 11 additions & 8 deletions R/tar-terra-rast.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
#' Provides a target format for [terra::SpatRaster-class] objects.
#'
#' @details
#' [terra::SpatRaster-class] objects do not contain raster data directly—they
#' contain a C++ pointer to memory where the data is stored. As a result, these
#' objects are not portable between R sessions without special handling, which
#' causes problems when including them in `targets` pipelines with
#' `tar_target()`. `tar_terra_rast()` handles this issue by writing and reading
#' the target as a geospatial file (specified by `filetype`) rather than saving
#' the `SpatRaster` object itself.
#'
#' The terra package uses objects like [terra::SpatRaster-class],
#' [terra::SpatVector-class], and [terra::SpatRasterDataset] (SDS), which do
#' not contain the data directly--they contain a C++ pointer to memory where
#' the data is stored. As a result, these objects are not portable between
#' R sessions without special handling, which causes problems when including
#' them in `targets` pipelines with [targets::tar_target()]. The functions,
#' [tar_terra_rast()], [tar_terra_sds()], [tar_terra_sprc()],
#' [tar_terra_tiles()], and [tar_terra_vect()] handle this issue by writing and
#' reading the target as a geospatial file (specified by `filetype`) rather
#' than saving the relevant object (e.g., `SpatRaster`, `SpatVector`, etc.),
#' itself.
#'
#' @param name Symbol, name of the target. A target name must be a valid name
#' for a symbol in R, and it must not start with a dot. See
Expand Down
4 changes: 4 additions & 0 deletions R/tar-terra-sprc.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#' Provides a target format for [terra::SpatRasterCollection] objects,
#' which have no restriction in the extent or other geometric parameters.
#'
#' @inherit tar_terra_rast details
#'
#' @param name Symbol, name of the target. A target name must be a valid name
#' for a symbol in R, and it must not start with a dot. See
#' [targets::tar_target()] for more information.
Expand Down Expand Up @@ -129,6 +131,8 @@ tar_terra_sprc <- function(
#' Provides a target format for [terra::SpatRasterDataset] objects,
#' which hold sub-datasets, each a `SpatRaster` that can have multiple layers.
#'
#' @inherit tar_terra_rast details
#'
#' @param name Symbol, name of the target. A target name must be a valid name
#' for a symbol in R, and it must not start with a dot. See
#' [targets::tar_target()] for more information.
Expand Down
9 changes: 1 addition & 8 deletions R/tar-terra-vect.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
#'
#' Provides a target format for [terra::SpatVector-class] objects.
#'
#' @details
#' [terra::SpatVector-class] objects do not contain vector data directly—they
#' contain a C++ pointer to memory where the data is stored. As a result, these
#' objects are not portable between R sessions without special handling, which
#' causes problems when including them in `targets` pipelines with
#' `tar_target()`. `tar_terra_rast()` handles this issue by writing and reading
#' the target as a geospatial file (specified by `filetype`) rather than saving
#' the `SpatVector` object itself.
#' @inherit tar_terra_rast details
#'
#' @param name Symbol, name of the target. A target name must be a valid name
#' for a symbol in R, and it must not start with a dot. See
Expand Down
18 changes: 11 additions & 7 deletions man/tar_terra_rast.Rd

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

13 changes: 13 additions & 0 deletions man/tar_terra_sds.Rd

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

13 changes: 13 additions & 0 deletions man/tar_terra_sprc.Rd

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

18 changes: 11 additions & 7 deletions man/tar_terra_vect.Rd

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

0 comments on commit 919a36e

Please sign in to comment.