raster object, SpatialPixels* object, SpatialGrid* object or file path of raster object stored on the disk (can be read via readGDAL), for more details see raster. The resolution of object should be the same in x and y direction.
tilesize
tile size in cells in x direction. nx = ny is assumed, total number of tile cells is tilesize by tilesize.
overlapping
overlapping cells in each direction
aspoints
if TRUE tiles are in form of SpatialPointsDataFrame
asfiles
if TRUE tiles are stored on local drive as raster objects
tilename
prefix given to file names
format
file format, see writeRaster
tiles_folder
folder to be created for tiles storage
parallel.processing
if TRUE parralel processing is performed via sfLapply
cpus
number of proccesing units
Value
The list of tiles in raster format or in SpatialPointsDataFrame format if aspoints=TRUE
data(regdata)
str(regdata@sp) # DEM and TWI data for Serbia at 1 km resolution
dem=regdata@sp['dem']
library(sp)
spplot(dem, col.regions=bpy.colors() )
str(dem)
# tiling dem in tiles 250x250 with 25 cells overlap
tiles = tiling(dem,tilesize=250,overlapping=25,aspoints=TRUE)
# number of tiles
length(tiles)
image(dem)
points(tiles[[1]] , pch='-' ,col ='green')
points(tiles[[2]], pch='.')
str(tiles[[1]])