I have an image as below. It is 2579*2388 pixels. Lets assume that it\'s bottom left corner is at 0,0. From that image I want to create multiple images as follows and save them
I think what you need is to create a function for your processing part (let's call it "fnc") and a table that lists the number of tiles that you have made (let's call it "tile.tbl") and also let's assume that your geobig data called "obj"
obj=GDALinfo("/pathtodata.tif")
tile.tbl <- getSpatialTiles(obj, block.x= your size of interest, return.SpatialPolygons=FALSE)
and then parallelize it using snowfall package. Here is an example:
library(snowfall)
sfInit(parallel=TRUE, cpus=parallel::detectCores())
sfExport("tile.tbl", "fnc")
sfLibrary(rgdal)
sfLibrary(raster)
out.lst <- sfClusterApplyLB(1:nrow(tile.tbl), function(x){ fnc(x, tile.tbl) })
sfStop()
For a detailed explanation please see HERE