The main features that I am trying to implement is:
1. put a raster object, already allocated, in the cacheManager
2. get a raster object from the cacheManager
As we know, in the first feature exist a border case, that is when the
number of raster objects is greater than the cacheManager size. In this
case, I just save in disk one of the rasters objects and put the new raster in
This solution appears be reachable, at least to me, but I am stuck in the
save to disk part. To save rasters in disk I tried to use the functions
'writeRaster' and 'writeValues'.
Specifically, my problem is when I already had a version of the same raster
written on disk, this seems to be solvable using the 'overwrite=TRUE'
parameter in the functions 'writeRaster' and 'writeValues', but I got some
errors in each implementation:
1. writeRaster - 'filenames of source and target should be different' you
can see this error message in the raster package code
2. writeValues - save the rasters in the disk, but when I read the
raster from disk, all values came as NA.
Note that I have little experience with rasters and R, if you see anything
stupid or stranger, please alert me.
So, anyone has a suggestion of a better implementation to save the rasters
in disk? Or can see any error in the save in disk implementation?