Closed groutr closed 7 months ago
@mdbartos I've implemented most of the variants of the priority-flood algorithm described in this paper into a priority-flood module on my machine. There are methods for finding the basins, filling depressions, computing flow direction, and resolving flats (though I had to slightly deviate from the algorithm in the paper to make in work for test DEM). Do you want these other methods in pysheds too?
@mdbartos I don't think the nodata_out parameter is needed any longer in fill_depressions. How do you feel about deprecating it?
Thanks again and awesome work, MDB
Fixes #239
Runtime is about 7.5min on a (12150, 9622) float32 raster which is acceptable.
This variant of the algorithm (as presented in the paper linked in the issue) uses a plain queue to avoid some of the overhead of using the priority queue. Since numba doesn't have a plain queue, I use a list that gets flushed periodically. A critical part of making this fast was using numba's typedlist which still seems to be experimental according to the docs.
I'm open to feedback.