Split gridded data extents into subsets for parallel processing.

gridTiles(X, n = NULL, px = c(1000, 1000), overlap = 0)

# S3 method for stars
gridTiles(X, n = NULL, px = c(1000, 1000), overlap = 0)

# S3 method for RasterLayer
gridTiles(X, n = NULL, px = c(1000, 1000), overlap = 0)

Arguments

X

The gridded (raster or stars) object to find tiles

n

number of tiles. Can be a vector length 1 or of length 2 (rows, columns)

px

number of pixels per side of a tile. Can be a vector of length 2 (rows, column pixels). Ignored if n provided. Default is 1000.

overlap

number of pixels of overlap between internal tiles

Value

data.frame where each row is a set of tile indices and sizes.

  • tid tile identification number (sequential)

  • xl leftmost column index

  • yl lowest row index

  • xu rightmost column index

  • yu topmost row index

  • cropXsize number of columns in the tile

  • cropYsize number of rows in the tile

@examples data("kampala") # example dataset g <- kampala$mastergrid

gridTiles(g) gridTiles(g, n=2) gridTiles(g, px=c(5, 25))

Details

gridTiles provides a convenient way for splitting a gridded dataset into sub-datasets for cropping or processing individually. The splitting uses the extent of the total grid, potentially including noData cells.