Skip to content

Commit

Permalink
added additional examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Aariq committed Sep 11, 2024
1 parent be1779b commit e9de43c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions R/tar_terra_tiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,31 @@ set_window <- function(raster, window) {
#' tile_grid(r, ncol = 2, nrow = 2)
#' tile_blocksize(r)
#' tile_n(r, 8)
#'
#' \dontrun{
#' #usage with tar_terra_tiles
#' list(
#' tar_terra_rast(
#' my_map,
#' terra::rast(system.file("ex/logo.tif", package = "terra"))
#' ),
#' tar_terra_tiles(
#' name = rast_split,
#' raster = my_map,
#' tile_fun = tile_blocksize
#' ),
#' tar_terra_tiles(
#' name = rast_split_grid,
#' raster = my_map,
#' tile_fun = \(x) tile_grid(x, ncol = 2, nrow = 2)
#' ),
#' tar_terra_tiles(
#' name = rast_split_n,
#' raster = my_map,
#' tile_fun = \(x) tile_n(x, n = 6)
#' )
#' )
#' }
tile_grid <- function(raster, ncol, nrow) {
template <- terra::rast(
x = terra::ext(raster),
Expand Down
25 changes: 25 additions & 0 deletions man/tile_helpers.Rd

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

0 comments on commit e9de43c

Please sign in to comment.