richdem icon indicating copy to clipboard operation
richdem copied to clipboard

Trouble with pit filling and slope applying

Open rbunel opened this issue 6 years ago • 1 comments

import richdem as rd
import numpy as np
dem              = nd.array([[250,260,265,270],[240,200,200,210],[230,220,225,205]])
dem              = rd.rdarray(dem, no_data=-9999)
dem_filled       = rd.FillDepressions(dem, epsilon=False, in_place=False,topology='D4')
dem_flat_resolve = rd.ResolveFlats(dem_filled, in_place=False)

print(dem)
print(dem_filled)
print(dem_flat_resolve)
>>> print(dem)
[[250 260 265 270]
 [240 200 200 210]
 [230 220 225 205]]
>>> print(dem_filled)
[[250 260 265 270]
 [240 210 210 210]
 [230 220 225 205]]
>>> print(dem_flat_resolve)
[[250 260 265 270]
 [240 206 208 210]
 [230 220 225 205]]
>>> 

I realize that when I try to correct flat areas with the ResolveFlats function, my flat area turns back into depression. The slope gradient for the flat area is in the opposite direction to what might be expected.

Could you please enlighten me on that point?

Thanks in advance

rbunel avatar Aug 31 '18 10:08 rbunel

@rbunel: This looks like a bug. I'll try to get around to fixing it soon.

r-barnes avatar Nov 02 '18 21:11 r-barnes