) I want to resample Sentinel-2 imagery so the resolution of two bands fit. I'm using raster::resample(raster1, raster2, method="ngb") for this, but the execution takes very very long. It is running for at least 15 minutes and so far I didn't obtain any output. I'm not sure if this will finish at some point.
I'm using bands 08 (10 m resolution) and 12 (20 m resolution) of Sentinel-2.
Resampling the same raster with QGIS takes a minute or so. I wanted to ask if this is a common problem with this function and if there is any workaround or another function/package I could use for that.
Thank you :-)
You could try the function gdalwarp
from the package gdalUtils
.
Here there is an example on how to use gdalwarp
for resampling:
https://csaybar.github.io/blog/2018/12/05/resample/
Here there is an example of a resampling function based ongdalwarp
:
https://rdrr.io/github/AybarCL/Dorado/src/R/resample_R.R
If you have GRASS GIS installed, you could also have a look at the fasterRaster
package that has a fasterProjectRaster
function.