Removing the flat and pit pixels from a DEM can be a challenging component of terrain analysis. Depending on the resolution and quality of the DEM as well as the extent of urbanisation in the catchment, flat and pit pixels can be hard to remove. The process is further complicated by the fact that the best removal technique for flat and pit pixels can be depended on the process that formed them. For example, flattened hill crests formed by ray based interpolation algorithms are best treated by a filling algorithm whereas those formed by low vertical precision may be best treated by the breaching algorithm.
The iterative filling algorithm simply raises all pit pixels to the elevation of their lowest neighbour and then raises all flat pixels by a set increment. This algorithm can be applied iteratively to treat large areas of flat pixels at the crest of hills.
The Breaching algorithm is an advanced breaching algorithm. The algorithm methodology is outlined in the algorithm section. In simple terms, the algorithm searches for a path to pixel of lower elevation, and where the gradient over that path (if linear interpolation was applied) is greater than a set threshold, that meets the following criteria:
1 Has the lowest elevation gain over the course of the path;
2 If two paths have the same elevation gain, the shorter path is selected.
As discussed previously, there a 4 parameters that may be edited in the Project Options form that affect how the breaching algorithm operates. These are repeated here for convenience.
Flat and Pit Removal Tab of Project Options form:
•Breaching Algorithm Minimum Gradient: This parameter governs the minimum gradient that must be observed over the breaching solution channel before the algorithms will determine that a solution has been found. This parameter can be adjusted to ensure legitimate breaching solutions are found and that rounding errors do not cause breaching solution channels to become flat. For example, if the breaching minimum gradient is too low then a very shallow slope may be calculated over the breaching channel. After linear interpolation is applied to determine pixel elevation over the channel, these elevations will be rounded to the precision of the DEM (single or double). This can cause these pixels to become flat.
•Treatment of Boundaries and Non-Defined Pixels: This parameter instructs the breaching algorithm what to do if a potential solution channel encounters a DEM boundary or blank pixel. Either the algorithm will terminate (the pit or flat will remain) or the algorithm will continue to search ignoring the boundary or blank pixel. The default option is to terminate the algorithm as ignoring the pixel can slow down the algorithm considerable and may also find solution channels that are not realistic (ie., the flow path from the flat or pit pixel may actually flow across the DEM boundary). In practise, the flat and pit pixels near the boundaries should not be in the catchment of interest anyway.
•Breaching Algorithm Break Size: This parameter has been introduced for speed reasons, once the breaching algorithm has grown very large looking for a potential solution channel over a wide area it can slow down considerable. Once the breaching algorithm has grown to the breaching Break Size the algorithm will terminate. If time is not a constraint this parameter can be adjusted upward to ensure the breaching algorithm finds even the most complex solutions.
Digital Elevation Model Tab of Project Options from:
•DEM Precision: The DEM precision parameter governs wether the DEM will be stored as single or double precision floating point values. Single precision stores 7-8 digits while double precision stores 15-16 digits. Selecting double precision will increase the size of the DEM file size by 100% and total project files by around 20% and runtimes by 20% as well as RAM requirements. Double precision may be required when using elevation data with several digital on the left side of the decimal point such as 10450.0560 ft or very flat DEMs or if you wish to use a low breaching minimum gradient parameter.
Using the Breaching Algorithm
You may wish to run a one or more iterations of the filling algorithm prior to running the breaching algorithm. This will ensure any erroneous low pixel elevations are filled to their lowest neighbour instead of potentially creating large deep channels to a far away lower pixel.
You can then run the breaching algorithm for the entire DEM, yellow lines will indicate the solution paths for pixels that were treated. After running the breaching algorithm once, there are a number of reasons why flat and pit pixels may remain in your DEM, these include:
Problems related to the pixel elevation:
•Problem: The pixel elevation is so low that an outlet can not be found within the DEM that is lower by a sufficient amount to satisfy the minimum downslope gradient criteria.
Solution: lower the minimum downslope gradient criteria. |
•Problem: A potential solution pixel is too far away (breaching algorithm exceeds minimum break size).
Solution: Increase break size criteria. |
•Problem: A potential solution pixel is to far away (breaching algorithm encounters a boundary or blank pixel prior to finding the solution pixel.
Solution: Assign elevations for blank pixels, either by interpolation or sampling. Alternatively, change blank pixel treatment to Ignore (note: that this may increase the time of the algorithm and cause unrealistic solution paths for pixels near the boundary) |
•Problem: The pixel is the lowest elevation pixel in the DEM.
Solution: Manually raise the pixel and its neighbours (using the Inspect Pixel form), or manually lower a pixel near the desired catchment outlet to serve as a outlet for the breaching algorithm. |
Problems relating to rounding:
•Problem: You may find that if the minimum downslope gradient is too low then the breaching algorithm will create a path of flat pixels along its solution path. This is caused by a very shallow gradient being converted to a series of stepped flat pixels when the elevations are rounded to the DEM precision (single or double)
Solution: Increase the minimum downslope gradient or change the DEM precision to double. |
Advanced Use of Breaching Algorithm
In extremely flat terrain or poor quality DEMs you can apply some special techniques to ensure flat and pit pixels are removed. These may include:
•Manually lower the elevation of a pixel near the catchment outlet (using the Inspect Pixel form) so as to serve as a solution for the breaching algorithm. You will need to ensure this pixel is not too close to the boundary and that this pixel is low enough to provide adequate slope to satisfy the minimum downslope criteria. You will also need to ensure the minimum break size is large enough to provide a solution for all flat and pit pixels.
•Burn a vector stream network into the topography prior to running the breaching algorithm. This could be an external stream network (imported) or a calculated vector stream network. To use a calculated vector stream network, first export it as a GIS file (Export >> Export GIS Data) and then import it as an imported stream network (GIS >> Streams), prior to applying stream burning (DEM Conditioning >> Burn Streams). This will lower pixels along the stream network and increase the gradient along potential breaching solutions paths, hence increasing the effectiveness of the algorithm.
•Using the DEM Conditioning >> Enforce Streams algorithm (see below).
Using a Stream Network to Aid Hydrologic Conditioning
An imported vector stream network can be useful during the interpolation of a DEM to ensure it is hydrologically accurate. However, an imported stream network can also be valuable when using an imported / sampled DEM. This network can be burnt into the DEM (DEM Conditioning >> Burn Streams) or the DEM Conditioning >> Enforce Streams can be used to ensure pixels underlying the vector network decrease in a downstream direction. This algorithm ensures that pixels underlying the stream network decrease in a downstream direction by applying linear interpolation to remove any rising part of the long-section along the stream as outlined below.
Figure 37: Interpolate Streams Over Existing DEM Algorithm
In Figure 37, the blue line represents the interpolated elevations assigned to the underlying pixels after application of the algorithm. The algorithm can only interpolate DEM pixels underlying a stream segment if two criteria are met.
•Firstly, CatchmentSIM must be able to determine the upstream and downstream ends of the stream segment. If it sits within the network and junction connectivity is provided (stream segments endpoints are within the specific tolerance Project Options | General) this shouldn't be a problem. However, if the stream segment is at the most downstream end of the catchment (ie., the outlet) then the pixel elevations underlying its endpoints must be different and must imply the correct flow direction along the stream segment. If not, the pixel underlying the downstream endpoint of the downstream segment can be manually edited using Create DEM >> Inspect Pixel to ensure these criteria is satisfied.
•The algorithm can only interpolate new pixel elevation if it can find a pixel of lower elevation along the line segment at some point. For example, in Figure 37, the channel illustrated by the blue line will only be interpolated by the algorithm in the case of the green DEM stream line profile as apposed to the red which never dips below the minimum elevation of the black profile. Thus the algorithm may be affected by very low pit pixel along the stream profile. This can be avoided by running one iteration of the filling algorithm prior to running the algorithm.
Note: | CatchmentSIM includes an intelligent algorithm that looks at pixel elevations throughout the stream segment as well as the network connectivity to assign flow directions in the 2D stream network. However, it can be fooled by 'dirty' or flat DEMs. |
In future versions of CatchmentSIM, it is envisaged that the user will be given the option of manual assignment of flow directions over the stream network to remove the reliance on the first criteria outlined above.
A combination of the filling algorithm and the breaching algorithm can form a hydrologically realistic DEM very quickly in virtually all case. In certain circumstances (very flat terrain or poor quality DEMs) it may be necessary to adjust the parameters of the breaching algorithm to achieve the desired results. In even rarer cases, where the desired catchment outlet may not be the lowest part of the DEM, some manual editing of the outlet pixel elevations, stream burning or interpolating an observed stream network over the DEM can fix the problem. This ensures that these algorithms can work where more simple approaches (such as the J&D algorithm) fail.