Speed-up terrain attribute calculation using convolution #486
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?