Optimized Tool for DEM Pit Removal now available

by Stephen Jackson, Graduate Research Assistant, Center for Research in Water Resources, The University of Texas at Austin, srj9@utexas.edu

LiDAR sceneExtracting hydrologic features such as stream centerlines and watershed extents from a Digital Elevation Model (DEM) typically requires first hydrologically conditioning the DEM. In this process the elevations are modified in order to clearly establish flow directions. Operations such as Flow Direction and Flow Accumulation can then be performed on the conditioned DEM. The Optimized Pit Removal tool provides an alternative to the Fill method of removing pits from a Digital Elevation Model (DEM).

A pit (or sink) is the lowest point of a depression with no outlet. This may be a real aspect of the terrain or an artifact of pre-processing operations on the raw terrain data, such as the removal of trees to create a bare earth LiDAR model. As localized points with no outlet, pits hinder the automated detection of regional flow paths. The current standard method of removing pits is to use the ArcGIS Fill tool.

One downside to the Fill method of removing pits is that it tends to obscure meaningful elevation data for wide areas upstream of any dam-like feature. This is especially prevalent when the terrain is flat and when working with high resolution data such as LiDAR. A new tool is now available based on the alternative pit removal strategy described by Pierre Soille (2004). This Optimized Pit Removal tool uses a combination of cut and fill to remove all undesired pits while minimizing the overall changes to the landscape. The user can choose to either minimize the absolute change in landscape elevation summed across all cells, or to minimize the net change in landscape elevation (effectively balancing cut and fill). An option is also provided to exclusively use cut.

Optimized pit removal tool results

The Optimized Pit Removal tool results in more natural flow path delineation upstream of dam-like features. This facilitates the delineation of fine-resolution flow paths at scales where obtaining vector data for stream burning would be infeasible, as well as reducing the amount of manual adjustment required for delineation at any scale.

Flow accumulation results

Using a 1 meter resolution LiDAR DEM provided by the Minnesota Department of Natural Resources, flow accumulation results were compared. In the above example, flow paths are displayed for every cell with a drainage area greater than 100 square meters. Using the standard ArcGIS Fill tool results in wide regions where all meaningful information is obscured. This effectively sets a lower limit on the scale to which analyses can be performed. In contrast, the results from the Optimized Pit Removal tool immediately appear more natural. On closer inspection the flow paths can be seen to follow vegetation coloration patterns, building lot lines, and even the curves of cul-de-sacs.

Appropriate conditioning, especially the choice of which depressions to remove, is dependent on the type of analysis being performed. For some applications, it may be desirable to leave selected pits in the DEM. The Optimized Pit Removal tool accomplishes this by treating any cell with No Data as a flow outlet, allowing the user to mark specific pits to be left unaltered. This method could also be used to mark inlets to underground conveyance structures, aiding in integrated surface water/storm sewer modeling.

The tool is available to download for free from the Center for Research in Water Resources, with additional documentation and sample data. Feedback, including interesting case studies and suggested improvements for future versions of the tool, can be directed to Stephen Jackson (srj9@utexas.edu).

This entry was posted in Hydro, Water Utilities and tagged , , , , , , , , , , . Bookmark the permalink.

Leave a Reply


  1. lahatte says:

    Nice. Doesn’t seem to work for ArcMap 10.0.

  2. mlago16 says:

    It looks like we developed a tool that fixes the same issue using a different approach. We named the tool “Fill Sinks Plus” and it is available at http://www.lago-consulting.com/fill_sinks_plus.html
    It would be interesting running the same cases with both tools in order to compare performances and elucidate details.
    Comments are welcome and can be sent to Marcelo Lago (marcelo@lago-consulting.com)

  3. magheralex says:

    It works on 10.2 version ?

  4. william.lidberg@gmail.co says:

    I can get it to work in arcgis 10.1 if i use the model and step size 1m
    I does not work with any step size less than that. I have tried using the tool in the cmd and arcgis but it does not work with a step size less than 1m.

    I do love the cut full statistic tool. It is very helpfull for comparing different fill/breach functions.

  5. ledwith says:


    The “Step size” parameter is causing problems.

    Based on my testing, the symbol used for the decimal separator will determine whether or not this tool will work as it should. It appears that a period (“.”) is hard-coded as the decimal separator so that computers that use a comma (“,”) as the separator will encounter problems.

    Whole numbers work fine but any number with a comma decimal separator will be truncated. So 1,5 becomes 1 and 0,5 becomes 0. When the number defaults to 0, the process apparently runs forever (I cancelled the process after 18 hours)…

    • ledwith says:

      There are a couple of work-arounds. One is to change the settings on the computer. I’ve done this with other AG extensions with mixed results.

      Another solution that works fine with this extension is to convert the elevation model to integer. In my case, I converted a 32-bit float (meters with two decimals) to a 16-bit integer (centimeter). Then use a whole number for the step size parameter.

  6. mosestkamau says:

    I would like you how you can help me to use the fill tool in arch gis since i have the license from kenyatta university and yet i cannot use it since i am told that there is an error with the spatial analyst tool.please help me on that.

  7. mosestkamau says:


  8. srj9 says:

    I am not currently actively developing the tool, but all of the documentation and code is available for free on GitHub. I encourage anyone with a knack for programming to make improvements and share them back to GitHub. There has been continual interest in this tool, and I hope to see the community continue to advance our hydrologic conditioning abilities.


    I’ve also noted the similar tool developed by Marcelo Lago at Lago Consulting, which may prove useful to those having difficulties. http://www.lago-consulting.com/fill_sinks_plus.html