<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi GRASS devs,</div><div class=""><br class=""></div><div class="">I am facing a r.watershed issue when I run it with the segmentation library (-m) and depressions. When I run:</div><div class=""><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">r.watershed -s elevation=elevation accumulation=accumulation drainage=drainage depressions=sinks</font></div></div><div class=""><br class=""></div><div class="">It works, but when I add the -m flag, it produces the following error:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">ERROR: bug in A* Search: doer -1903 heap size 0 count 40036125</font></div><div class=""><font face="Menlo" class="">WARNING: Subprocess failed with exit code 1</font></div><div class=""><font face="Menlo" class="">WARNING: category information for [accumulation__cells] in</font></div><div class=""><font face="Menlo" class="">         [r_watershed_sfd] missing or invalid</font></div><div class=""><font face="Menlo" class="">WARNING: category information for [drainage] in [r_watershed_sfd] missing</font></div><div class=""><font face="Menlo" class="">         or invalid</font></div></div><div class=""><br class=""></div><div class="">I have tried to reproduce this in the North Carolina dataset with random sink points but have so far failed. If I run it with a single cell and many randomly assigned cells as depressions on my DEM, it works fine. Unfortunately, I wasn't able to infer a situation in the elevation and depressions raster where this bug/condition (in the code <a href="https://github.com/OSGeo/grass/blob/30cca6bc45b0a21a9e370f0bfdc1e9a2713b1ab8/raster/r.watershed/seg/do_astar.c#L147" class="">https://github.com/OSGeo/grass/blob/30cca6bc45b0a21a9e370f0bfdc1e9a2713b1ab8/raster/r.watershed/seg/do_astar.c#L147</a> i.e. doer != -1) is met.</div><div class=""><br class=""></div><div class="">One issue might be that in some depressions, the elevation is actually below 0. I have tested this and it seems to work for elevations of -10 but it didnt for -200. I cant see anything that would cause this in the do_astar routine, which lead me to conclude that it probably has to do with something else.</div><div class=""><br class=""></div><div class="">Does someone know what might lead to this error? Are there any conditions that the depressions and/or the elevation map need to fulfil in the segmentation version of r.watershed that are not needed in the in-memory version?</div><div class=""><br class=""></div><div class="">Best wishes,</div><div class="">Michel</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><br class=""><div class="">
<meta charset="UTF-8" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>-- <br class=""><span style="font-style: normal;" class=""><b class="">Dr. Michel Wortmann <br class=""></b></span>Potsdam Institute for Climate Impact Research <br class="">Research Department II: Climate Resilience<br class="">Phone: +49 331 288 2546<br class=""><a href="mailto:wortmann@pik-potsdam.de" class="">wortmann@pik-potsdam.de</a><br class="">www.pik-potsdam.de/members/wortmann</div></div>
</div>
<br class=""></body></html>