How do I resample the 0.7 m LiDAR to 10 m DEM in R?
What are the basic rules for checking the consistency?
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 resample from 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 r:
xmn, ymn parameters). ORext (extent, aka bounding box). If you want r and s to 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. ANDcrs (Coordinate Reference System).Check the raster function to know how to set above parameters in s.
raster::aggregate looks like a promising approach (which I haven't used). However, it requires an integer factor, whereas 0.7 is not a factor of 10...
– Mike T
Jan 22 '19 at 01:44