dtarb / TauDEM

Terrain Analysis Using Digital Elevation Models (TauDEM) software for hydrologic terrain analysis and channel network extraction.
http://hydrology.usu.edu/taudem
Other
235 stars 116 forks source link

D8 produces potentially bad results in some cases #60

Open kornholi opened 8 years ago

kornholi commented 8 years ago

Hi,

While trying to figure out where the inconsistencies are coming from in my version of D8, I ran into some weird cases. I used an NED tile, which was converted to integer values and pitremove'd. Using normal float elevations usually doesn't produce too many differences between the algorithms, but the integer ones do.

For example, here's a small area with the differing cells in red (these are the output p rasters): 1459281678

Results from TauDEM 5.3.3: 1459281702

Results from my new algorithm: 1459281707

As we can see, TauDEM seems to assign the same direction for all cells in some flats, while my version produces more natural looking results. @ahmetartu agrees that this looks odd and asked me to open this issue.

Are we missing something?

dtarb commented 8 years ago

@kornholi, rounding elevation values to integer can change the configuration of flats, so is expected to change the results. Whether these differences are reasonable or not would depend on the actual data. For example if you have elevations 9.4, 10.1, 10, 9.9, 9.8, 9.8, 9.7, 8.4 in one dimension you only have one flat (the left hand 9.8), and it would drain to the right However rounded this is 9, 10, 10, 10, 10, 10, 10, 8 so you have 4 flat cells and 2 would drain to left and 2 to right. In 2D it is obviously more complicated, but rounding will affect the results. This is why we prefer floating point grids.