Last modified 5 years ago Last modified on 08/23/13 11:17:58

Local Minima Basins

One helpful concept for eliminating routing problems caused by local minima is that of local minima basins - a group of cells that flows into one local minima. By looking at the flow of spill basins within areas flooded by terrastream, we can model accurately where water would flow in the original terrain.

We want a map that looks like this, where the different colored regions are the basins in flat areas, the brown dots are the local minima, and the red line is an example routing technique.

The following grass commands create a raster that has basin ids only for cells that are flat.

Input: sweep (rast with labeled flat areas)
       basins (rast with labeled basins)

>r.mapcalc flat_basins="if(sweep>0,basins,null())"
>r.out.gdal flat_basins output=flat_basins.tif nodata=-9999.0