I have 2 raster images of different spatial resolution and projection.
I want to resample multiple coarser images (0.25 degrees) to finer resolution(4 km) based on one finer resolution image which is of 4 km. Both are in different folders. I am not getting how to do that.
I had written the code in R but I am getting an error.
library(resample)
>setwd("D:/mtech project/data/DEC 16/RH/1-DEC-16/extracted/")
>inFiles1 <- list.files(pattern="*.tif")
> nFiles1 <- length(inFiles1)
> setwd("D:/mtech project/data/extracted/")
> inFiles2 <- raster("3DIMG_01DEC2016_0000_L2C_FOG_FOG.tif")
> for (i in 1:nFiles1) {
+ r1<-raster(inFiles1[[i]])
+ r2<-inFiles2
+ rs<-resample(r1,r2,method="bilinear")
+ write.Raster(rs, paste0('D:/mtech project/data/DEC 16/RH/RESAMPLED/rs_',i,'.img'), overwrite=T)
+ }
Error in .local(.Object, ...) :
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", : Cannot create a RasterLayer object from this file. (file does not exist)
`
"D://mtech/..."
?