tile: Split a raster into tiles

Description Usage Arguments Value See Also Examples

View source: R/tile.R

Description

This function is used to split a raster into smaller tiles. The raster is split in a grid pattern with nx columns and ny rows.

Usage

1
tile(x, nx, ny, filename = "", suffix = NULL, ...)

Arguments

x

Raster* object to split

nx

Number of horizontal cells in the splitting grid

ny

Number of vertical cells in the splitting grid

filename

Character. Output file name including path to directory and eventually extension.Default is "" (output not written to disk).

suffix

Character appended to filename to differentiate tiles (must have length nx x ny). If left NULL, tiles will be numbered by columns and rows

...

Additional parameters passed to writeRaster

Value

A list of Raster* objects

See Also

crop

Examples

1
2
3
4
5
6
7
# Load raster package
library(raster)

elev_p95 <- stack(system.file("extdata/examples/ALS_metrics_p95.tif",package="foster"))

# Split elev_p95 into a 1 x 2 grid
tile(elev_p95, nx = 1, ny = 2)

mqueinnec/foster documentation built on March 28, 2021, 4:27 p.m.