tiling {meteo} | R Documentation |
Tiling raster or Spatial-class Grid or Pixels (data frame) object to smaller parts with optional overlap.
tiling(filename,tilesize=500,overlapping=50, aspoints= FALSE, asfiles=FALSE,tilename="tile", format="GTiff", tiles_folder=paste(getwd(),'tiles',sep='/'), parallel.processing=FALSE, cpus=6)
filename |
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 |
overlapping |
overlapping cells in each direction |
aspoints |
if TRUE tiles are in form of |
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 snowfall-calculation, sfLapply function. |
cpus |
number of proccesing units |
The list of tiles in raster format or in SpatialPointsDataFrame
format if aspoints=TRUE
Milan Kilibarda kili@grf.bg.ac.rs
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]])