0

I am trying to calculate Elevation, Slope and Aspect using SRTM-DEM in 500m resolution. The SRTM-DEM coordinate system is in UTM and the resolution is 30m. How to get the SRTM resolution in 500m and calculate elevation, slope and aspect with the same extent.

I disaggregated my SRTM by a factor of 3 and then aggregated by a factor of 50 but it doesn't give me the same extent as my MODIS raster.

modis
#class      : RasterLayer 
#dimensions : 804, 1146, 921384  (nrow, ncol, ncell)
#resolution : 500, 500  (x, y)
#extent     : 364000, 937000, 3693500, 4095500  (xmin, xmax, ymin, ymax)

srtm
#class      : RasterLayer 
#dimensions : 804, 1145, 920580  (nrow, ncol, ncell)
#resolution : 500, 500  (x, y)
#extent     : 364486.3, 936986.3, 3693292, 4095292  (xmin, xmax, ymin, ymax)

How to solve this problem?

Robert Hijmans
  • 40,301
  • 4
  • 55
  • 63
  • 1
    Info on resampling a raster here: https://stackoverflow.com/questions/32278825/how-to-change-the-resolution-of-a-raster-layer-in-r?rq=1 – Stewart Macdonald Dec 18 '22 at 02:10
  • Thank you for your suggestion. It means you are recommending to use resampling instead of aggregate and calculate elevation, slope and aspect? @Stewart Macdonald – user20664990 Dec 18 '22 at 10:10

1 Answers1

2

I think that the best way to estimate slope and aspect at a lower resolution is to compute it at the highest resolution and then aggregate these values (with the circular mean for aspect). If you aggregate first you underestimate the average slope. Aspect is probably less affected.

To aggregate from a resolution of 30 to 500 you could first disaggregate by a factor of 3 and then aggregate by a factor of 50.

library(terra)
r <- rast(res=30, xmin=0, xmax=990, ymin=0, ymax=990)
d <- disagg(r, 3)
a <- aggregate(d, 50)

But since the geometries do not align, you need to use resample after the aggregation (or instead of).

Robert Hijmans
  • 40,301
  • 4
  • 55
  • 63
  • Thank you for your answer. How about elevation classification with 500m elevation difference? Do I have to aggregate and then calculate elevation? I have raster datasets with 500m resolution and the column and row are 1146 & 804 respectively. Is it possible to use different factor for column and row and get the elevation, slope and aspect with the same extent using aggregate?@Robert_Hijmans – user20664990 Dec 18 '22 at 10:57
  • see `?terra::aggregate` – Robert Hijmans Dec 18 '22 at 11:01
  • I first disaggregated my SRTM by a factor of 3 and then aggregated by a factor of 50 but it doesn't give me the same extent as my MODIS landcover raster. SRTM: dimensions : 804, 1145, 920580 (nrow, ncol, ncell) resolution : 500, 500 (x, y) extent : 364486.3, 936986.3, 3693292, 4095292 (xmin, xmax, ymin, ymax) Landcover: dimensions : 804, 1146, 921384 (nrow, ncol, ncell) resolution : 500, 500 (x, y) extent : 364000, 937000, 3693500, 4095500 (xmin, xmax, ymin, ymax) How to solve this problem?@Robert_Hijmans – user20664990 Dec 19 '22 at 12:00
  • The comments are not suitable for discussions like this. Rather, you should ask a much more detailed question where you include the above. You can either edit your question or ask a new question. – Robert Hijmans Dec 19 '22 at 15:17