I need to merge together 20 32 bit tiff. For that I tried ArcGis but it keeps crashing (the individual tiff are about 1GB). I need a finale Tiff in order to run some analysis and I figured that having 20 different file would be messy for the user who is going to do the analysis.
I found a mosaic tool in the raster package in R but I can't really figure out how to use it. My first idea was to create a list of the tiff and then ask the mosaic tool to process it but it gives me error.
Error in function (classes, fdef, mtable) : unable to find an inherited method for function "mosaic", for signature "list", "missing"
I found this script online but it seems that many function doesn't work anymore
require(raster)
input.rasters <- lapply(list.files(pattern="^TmB50.*[.]tif$"), raster)
full.extent <- unionExtent(input.rasters)
bounding.raster <- raster(full.extent,crs=projection(input.rasters[[1]]))
res(bounding.raster) <- res(input.rasters[[5]])
resampled.rasters <- lapply(input.rasters, function(input.raster) {
target.raster <- crop(bounding.raster, input.raster)
resample(input.raster, target.raster, method="bilinear")
})
raster.mosaic <- mosaic(resampled.rasters, fun=max)
source http://www.nceas.ucsb.edu/scicomp/usecases/createrasterimagemosaic
Any idea how I could do that?