tiling | R Documentation |
Tiling raster or Spatial-class Grid or Pixels (data frame) object to smaller parts with optional overlap.
tiling(rast,
tilesize=500,
overlapping=50,
aspoints= NA,
asfiles=FALSE,
tilename="tile",
tiles_folder='tiles',
parallel.processing=FALSE,
cpus=6,
...)
rast |
SpatRaster, SpatialPixels* object, SpatialGrid* object or file path to raster object stored on the disk (can be read via rast), for more details see SpatRaster. The resolution of the raster should be the same in x and y direction. |
tilesize |
integer or vector; tile size in number of cells. Can be a vector of tilesize in x and y direction. Total number of tile cells is |
overlapping |
integer or vector; overlapping in number of cells. Can be a vector of overlapping in x and y direction. |
aspoints |
character; Posiible values are |
asfiles |
boolean; if TRUE tiles are stored on local drive as raster objects. |
tilename |
character; prefix given to file names |
tiles_folder |
character; destination folder where tiles will be stored. If doesn't exist, the folder will be created. |
parallel.processing |
boolean; if TRUE parralel processing is performed via snowfall-calculation, sfLapply function. |
cpus |
integer; number of proccesing units. |
... |
character; additional arguments for for writing files, see writeRaster. |
The list of tiles in SpatRaster-class format or in sf-class, SpatVector or SpatialPointsDataFrame format if aspoints=TRUE
.
Milan Kilibarda kili@grf.bg.ac.rs
pred.strk
library(sp)
demo(meuse, echo=FALSE)
rast <- terra::rast(meuse.grid[, "dist"])
# tiling dem in tiles 250x250 with 25 cells overlap
tiles = tiling(rast,
tilesize=20,
overlapping=5,
aspoints=TRUE)
# number of tiles
length(tiles)
plot(rast)
plot(tiles[[1]] , pch='-' ,col ='green', add=TRUE)
plot(tiles[[2]], pch='.', add=TRUE)
str(tiles[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.