<div dir="ltr"><div>Hi Vaclav,<br><br>On Sun, Nov 26, 2017 at 1:31 AM, Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>> wrote:<br>><br>> Hi all,<br>><br>> r.fill.dir with the bellow artificial DEM leaves part of the directions unresolved and this area is marked in areas, although the area is filled in the output. Here is the code to reproduce:<br>><br>> g.region n=220750 s=220000 w=638300 e=639000 nsres=1 ewres=1 rows=750 cols=700 -p<br>> r.mapcalc "hills = 500 * sin(row()) + 500 * sin(col())"<br>> r.fill.dir input=hills output=filled direction=directions areas=areas<br>><br>> In r71809, I have committed a fix which transforms these unresolved directions to NULLs because in the previous implementation (current 7.4svn and older) internal representation of angles was leaking outside of the module.<br>><br>> I have 2 questions:<br>><br>> Should I backport r71809 to 7.4?<br><br></div>For me, the fix makes sense.<br><div>><br>> Should we pursue this issue further to resolve why these edge cases are not resolved, although they are filled? Does anybody has suggestions at this point? (Paper with the method is linked in the doc.)<br></div><div><br></div><div>I don't think it is worth the pursue the issue of directions any further. The module is based on rather old, not to say outdated, methods from the 1980's. These methods were developed for DEMs created from contour lines which in turn were determined by land surveyors. Back then there was nothing like SRTM or LiDAR.</div><div><br></div><div>r.hydrodem offers a more advanced method to remove sinks by a combination of filling and carving.</div><div><br></div><div>Directions can also be obtained with r.slope.aspect or with the hydrological modules r.watershed, r.stream.extract, r.terraflow. Regarding hydrology, main flow directions may differ between modules and settings and to directions from r.slope.aspect, but all of them are valid according to the logic of the underlying algorithm and settings.</div><div><br></div><div>Markus M<br></div><div>><br>> Thank you,<br>> Vaclav<br>><br>> <a href="https://trac.osgeo.org/grass/changeset/71809">https://trac.osgeo.org/grass/changeset/71809</a><br>> <a href="https://grass.osgeo.org/grass74/manuals/r.fill.dir.html">https://grass.osgeo.org/grass74/manuals/r.fill.dir.html</a><br>><br>> _______________________________________________<br>> grass-dev mailing list<br>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-dev">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><br><br></div></div>