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.

5 Answers 5


GRASS has r.fill.dir and better yet, r.terraflow, which is one of the few hydrology tools to work on massive rasters. There's also TauDem, which includes PitRemove for filling.

  • 2
    I've also written a piece of software, RichDEM, which has a variety of fast (sometimes thousands of times faster) algorithms for depression filling and other hydrological applications. See: richdem.readthedocs.io/en/latest/depression_filling.html
    – Richard
    Commented Feb 8, 2018 at 22:57
  • TauDem is cross platform and works fine on Linux and OS X.
    – mankoff
    Commented Feb 9, 2018 at 0:19
  • @mankoff thanks for the update, that's great. Earlier releases were Windows only (I know 3.1 was, but perhaps later versions as well). Unfortunately the download page doesn't include references to it, but I do see a PPA containing it, along with a homebrew package.
    – scw
    Commented Feb 13, 2018 at 17:24

SAGA has several fill methods


Flat Detection
Sink Drainage Route Detection
Sink Removal
Fill Sinks (Planchon/Darboux, 2001)
Fill Sinks (Wang & Liu)
Fill Sinks XXL (Wang & Liu)

  • Note that the Planchon & Darboux (2001) method produces the same results as Wang & Liu (2006), just much, much slower. No one should use P&D if an alternative is available. Barnes (2014), Zhou (2016), and Wei (2018) improve on the speed of Wang & Liu (2006), collectively achieving a 6x or more speed-up.
    – Richard
    Commented Feb 8, 2018 at 22:59

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.)


Yeap, there is. I haven't tested yet, but I ran my eyes trough the source code. It seems a good program.



Landserf (free to use) - Click to Goto Homepage

I have used it, and love it.

I also think the algorithms are much more accurate in Landserf than in Arc, very very solid maths used and Jo Wood lists the maths used for his analysis.

Not the answer you're looking for? Browse other questions tagged or ask your own question.