I have a large elevation raster from the ASTER database made by using raster::mosaic()
. Each tile represents a one-degree by one-degree portion of the earth with an estimated raster resolution of 30m^2. I include the code that I used to mosaic them below, but I don't believe that it is the problem.
Mosaic <- do.call(mosaic,c(list of rasters, tolerance = 1, fun=mean)
Once that is run, I get the following elevation tif, which you can DOWNLOAD HERE.
I then measure the topographic ruggedness using raster::terrain()
, using theTerrain Ruggedness Index as my method:
TRI <- terrain(Mosaic, opt="TRI")
This yields:
As you can see, there are faint streaks in the map which I cannot explain. Due to the full extent of my study, I need to aggregate this raster to a coarser resolution. Therefore I use the aggregate function in the raster package as well.
TRI_Agg <- aggregate(TRI,fact = 255, fun = mean)
This yields the following raster.
Here you can see that the streaks are much more pronounced and fairly consistent throughout the whole map. I tried doing this with other study areas and the problem persisted (i.e this would happen with raster tiles all around the world). I can't explain why those streaks are occurring. I have attempted different ways of going about this which include doing a neighborhood analysis (to fill in missing values if any) and processing the tiles before mosaicing them together. None of these have worked.
When I aggregate the raster before, the roughness calculation, the streaks do not appear which makes me believe this issue arises when using aggregate()
. However, for my specific research question, I cannot calculate TRI using an aggregated raster.
TRI
? – Wingfootedraster::aggregate
. Is there a way you can make this problem more reproducible, say with an elevation raster usingraster::getData()
? See the docs?getData()
for examples. – Sivialibrary(raster) ; france <- getData('alt', country='FRA', mask=TRUE) ; plot(france)
, see if you can make a reproducible example out of this, and if so, edit your question. It will remove barriers between people trying to solve your problem, because as it stands, in order to reproduce your problem, they need to download the massive dataset you've linked to. – Sivia