You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to delineate a watershed using a flow pointer raster and a shape file with one pour point, the watershed tool crashes. The same operation works, if the pour point is provided as a raster file.
This produced the following error message and backtrace:
Reading data...
Locating pour points: 0%
thread 'main' panicked at whitebox-tools-app\src\tools\hydro_analysis\watershed.rs:321:60:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
0: 0x7ff74a174f3a -
1: 0x7ff74a19719b -
2: 0x7ff74a170b41 -
3: 0x7ff74a174d26 -
4: 0x7ff74a17714f -
5: 0x7ff74a176de7 -
6: 0x7ff74a17768d -
7: 0x7ff74a177549 -
8: 0x7ff74a175849 -
9: 0x7ff74a177206 -
10: 0x7ff74a1b9a97 -
11: 0x7ff74a1b9c44 -
12: 0x7ff7498ea27c -
13: 0x7ff7495637e6 -
14: 0x7ff74955e957 -
15: 0x7ff748ecca96 -
16: 0x7ff749e6d05c -
17: 0x7ff74a16b792 -
18: 0x7ff74956afcc -
19: 0x7ff74a1a970c -
20: 0x7ffb263a7ac4 - BaseThreadInitThunk
21: 0x7ffb27f6a8c1 - RtlUserThreadStart
If I interpret the backtrace correctly, the issue seems to occur in line 321:
I tried to dig deeper to understand how Whitebox handles shapefiles, but, as I am not (yet) familiar with Whitebox' source code and Rust, I didn't go further. If I were to guess, I would suspect either an issue with the shape file (created in QGIS) and/or an issue with how Whitebox handles the shape file.
The text was updated successfully, but these errors were encountered:
When trying to delineate a watershed using a flow pointer raster and a shape file with one pour point, the watershed tool crashes. The same operation works, if the pour point is provided as a raster file.
Note, that this issue seems to be different from the one reported here: Watershed Tool - thread 'main' panicked at 'Unrecognized raster type' #153
System: Windows 10 (all updates until 2025), Whitebox tools version 2.4.0, whitebox_runner.exe, and command line window.
Steps to reproduce:
Attached fle: 20250123_WBT_Watershed_Issue.zip
The problem can also be reproduced even using command line or QGIS (with the latest whitebox plugin).
I also ran the following command using cmd after enabling rust backtracing:
C:\misc\whitebox_tools.exe -r=Watershed --wd="D:\misc\wtr_shd.tif" --d8_pntr='D:\misc\pntr_D8_esri.tif' --pour_pts='D:\misc\pourpoint.shp' --output='D:\misc\wtr_shd.tif' --esri_pntr -v=true --compress_rasters=true
This produced the following error message and backtrace:
Reading data...
Locating pour points: 0%
thread 'main' panicked at whitebox-tools-app\src\tools\hydro_analysis\watershed.rs:321:60:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
0: 0x7ff74a174f3a -
1: 0x7ff74a19719b -
2: 0x7ff74a170b41 -
3: 0x7ff74a174d26 -
4: 0x7ff74a17714f -
5: 0x7ff74a176de7 -
6: 0x7ff74a17768d -
7: 0x7ff74a177549 -
8: 0x7ff74a175849 -
9: 0x7ff74a177206 -
10: 0x7ff74a1b9a97 -
11: 0x7ff74a1b9c44 -
12: 0x7ff7498ea27c -
13: 0x7ff7495637e6 -
14: 0x7ff74955e957 -
15: 0x7ff748ecca96 -
16: 0x7ff749e6d05c -
17: 0x7ff74a16b792 -
18: 0x7ff74956afcc -
19: 0x7ff74a1a970c -
20: 0x7ffb263a7ac4 - BaseThreadInitThunk
21: 0x7ffb27f6a8c1 - RtlUserThreadStart
If I interpret the backtrace correctly, the issue seems to occur in line 321:
I tried to dig deeper to understand how Whitebox handles shapefiles, but, as I am not (yet) familiar with Whitebox' source code and Rust, I didn't go further. If I were to guess, I would suspect either an issue with the shape file (created in QGIS) and/or an issue with how Whitebox handles the shape file.
The text was updated successfully, but these errors were encountered: