Hi GRASS devs,

I am facing a r.watershed issue when I run it with the segmentation library 
(-m) and depressions. When I run:

r.watershed -s elevation=elevation accumulation=accumulation drainage=drainage 
depressions=sinks

It works, but when I add the -m flag, it produces the following error:

ERROR: bug in A* Search: doer -1903 heap size 0 count 40036125
WARNING: Subprocess failed with exit code 1
WARNING: category information for [accumulation__cells] in
         [r_watershed_sfd] missing or invalid
WARNING: category information for [drainage] in [r_watershed_sfd] missing
         or invalid

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 
https://github.com/OSGeo/grass/blob/30cca6bc45b0a21a9e370f0bfdc1e9a2713b1ab8/raster/r.watershed/seg/do_astar.c#L147
 
<https://github.com/OSGeo/grass/blob/30cca6bc45b0a21a9e370f0bfdc1e9a2713b1ab8/raster/r.watershed/seg/do_astar.c#L147>
 i.e. doer != -1) is met.

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.

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?

Best wishes,
Michel




-- 
Dr. Michel Wortmann 
Potsdam Institute for Climate Impact Research 
Research Department II: Climate Resilience
Phone: +49 331 288 2546
wortm...@pik-potsdam.de
www.pik-potsdam.de/members/wortmann

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to