How do I resample the 0.7 m LiDAR to 10 m DEM in R?

What are the basic rules for checking the consistency?

  • Didn't you ask this yesterday? gis.stackexchange.com/questions/309311/… – Michael Stimson Jan 22 '19 at 0:19
  • @MichaelStimson That question was re-scoped from being about ArcGIS Desktop or R to being about just ArcGIS Desktop. – PolyGeo Jan 22 '19 at 0:21
  • I see. I'd do this with GDAL_Translate -tr 10 10 unless there's a lot of images to do. – Michael Stimson Jan 22 '19 at 0:27
  • Do you have GDAL? If so, use "gdalwarp -tr 10 10 -r average src_dataset dst_dataset" to do a proper down sample. – Mike T Jan 22 '19 at 0:43
  • What do you mean by "consistency"? – Spacedman Jan 22 '19 at 7:48

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')

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:

  • origin (see xmn, ymn parameters). OR
  • ext (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. AND
  • crs (Coordinate Reference System).

Check the raster function to know how to set above parameters in s.

  • The question is about aggregation, not about interpolation. – Mike T Jan 22 '19 at 1:05
  • 1
    @MikeT, the question is about resampling, which is a method of interpolation (one interpolates within the new cell, from the previous multiple cells; but aggregation is correct as well). – Andre Silva Jan 22 '19 at 1:08
  • 1
    A bilinear method is good for interpolation (i.e. constructing new data points within the range of a discrete set of known data points). However, bilinear is a poor choice when aggregating to a coarser resolution. See more details here and here. – Mike T Jan 22 '19 at 1:20
  • 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 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.