GlacioHack / xdem

Analysis of digital elevation models (DEMs)
https://xdem.readthedocs.io/
MIT License
139 stars 39 forks source link

Speed-up terrain attribute calculation using convolution #486

Open rhugonnet opened 6 months ago

rhugonnet commented 6 months ago

Ongoing

Resolves #302

For the (frequent) case of desiring no edge-filling or nodata-filling method during terrain attribute derivation, we can use a 3D convolution (already implemented with a function hidden in spatialstats.py) for fast computing of terrain attributes. This should work for almost all but fractal rugosity. Convolution can be done through SciPy or Numba (which one is fastest depends on matrix size and convolution kernel size).

Additionally, our current functions are deriving all coefficients of Zevenberg and Thorne (A, B, C, ... to I), while less than half are typically used for terrain attributes! (A, B, C and I are virtually useless, and D, E and F only required for curvature).

To-do

Bonus?