Wrappers around terra::getTileExtents()
that return a list of named numeric
vectors describing the extents of tiles rather than SpatExtent
objects.
While these may have general use, they are intended primarily for supplying
to the tile_fun
argument of tar_terra_tiles()
.
Usage
tile_grid(raster, ncol, nrow)
tile_blocksize(raster, n_blocks_row = 1, n_blocks_col = 1)
tile_n(raster, n)
Arguments
- raster
a SpatRaster object.
- ncol
integer; number of columns to split the SpatRaster into.
- nrow
integer; number of rows to split the SpatRaster into.
- n_blocks_row
integer; multiple of blocksize to include in each tile vertically.
- n_blocks_col
integer; multiple of blocksize to include in each tile horizontally.
- n
integer; total number of tiles to split the SpatRaster into.
Value
list of named numeric vectors with xmin, xmax, ymin, and ymax values
that can be coerced to SpatExtent objects with terra::ext()
.
Details
tile_blocksize()
creates extents using the raster's native blocksize (see
terra::fileBlocksize()
), which should be more memory efficient. Create
tiles with multiples of the raster's blocksize with n_blocks_row
and
n_blocks_col
. We strongly suggest the user explore how many tiles are
created by tile_blocksize()
before creating a dynamically branched target
using this helper. tile_grid()
allows specification of a number of rows and
columns to split the raster into. E.g. nrow = 2 and ncol = 2 would create 4
tiles (because it specifies a 2x2 matrix, which has 4 elements).