How do I resample the 0.7 m LiDAR to 10 m DEM in R?
What are the basic rules for checking the consistency?
One way to do is using
raster package. Two methods are available: 'bilinear' and 'nearest neighbour' (pick nearest neighbour, as suggested in Resample binary raster to give *proportion* within new cell window).
See the example code from
raster package documentation:
# this is a sample code which you need to adapt to your specific case. r <- raster(nrow=3, ncol=3) r <- 1:ncell(r) s <- raster(nrow=10, ncol=10) s <- resample(r, s, method='bilinear') #par(mfrow=c(1,2))
In the example above,
r is your 0.7 m LiDAR DEM, and
s is the raster object to be resampled. Make sure
s has the following parameters equal to
ext(extent, aka bounding box). If you want
sto have the same extent (i.e., to match in their outside borders), you need to resample to a cell size multiple from 0.7 m. For example, 9.8 m. AND
crs(Coordinate Reference System).
raster function to know how to set above parameters in