Skip to content

Are there any open source tools to detect and fill sinks on a DEM?

An answer to this question on the GIS Stack Exchange.

Question

Are there any open source or inexpensive tools to detect and fill sinks on a DEM? ArcGIS Spatial Analyst is just out of my price range.

Answer

This is actually an area of active research for me.

You can use the Priority-Flood algorithm as described by this journal article, which is also available on arXiv. This allows you to fill depressions in O(n log n) time for floating-point data and O(n) time for integer data. Source code is available here.

The foregoing algorithm is serial and works well up to a hundred million cells or so. Sometimes, though, your datasets are larger.

This article, also available on arXiv, describes an algorithm with excellent scaling suitable for datasets of up to a trillion or more cells. Source is available here.

All of the foregoing is now included in RichDEM's Python wrapper. Documentation, with examples and pretty pictures, is available here.

Depression-filling as performed on Beauford watershed

(Disclaimer: I wrote the articles and code mentioned above.)