r-barnes / richdem

High-performance Terrain and Hydrology Analysis
GNU General Public License v3.0
264 stars 67 forks source link

Expose PriorityFloodWatersheds_Barnes2014 to Python #54

Closed feefladder closed 2 years ago

feefladder commented 2 years ago

What the title says. nothing more, nothing less.

@giswqs maybe mentioned this in #53

I ran the following test script:

import richdem as rd
import numpy as np

dem = rd.rdarray(np.array([
    [1,2,3,4,5],
    [1,2,3,4,5],
    [1,2,3,4,5],
    [1,2,3,4,5],
    [1,2,3,4,5],]),no_data=0)

print(rd.LabelWaterSheds(dem))

with output:

[[ 1  6  9 11 16]
 [ 5  1  6  6 13]
 [ 2  2  2  6 15]
 [ 3  2  2  8 12]
 [ 4  7  8 10 14]]

which is a bit weird because of flat areas in my sample dem, but shows that it works.

feefladder commented 2 years ago

So I found out that I'm on a wayy too old version.. closing now