mdbartos / pysheds

:earth_americas: Simple and fast watershed delineation in python.
GNU General Public License v3.0
708 stars 191 forks source link

RFS - error #189

Closed Wytsepetrie closed 2 years ago

Wytsepetrie commented 2 years ago

The rapid flood spilling method of this library is exactly what I want to use for my report. I want to do something familiar like your RFSM example, so I was trying to run that code. However, I keep getting the same error. I have the feeling that it has something to do with the way I installed pysheds, do you have any idea or did you recognize the error.

`%matplotlib inline

import numpy as np from pysheds.rfsm import RFSM from pysheds.grid import Grid

import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cm from mpl_toolkits.mplot3d import Axes3D

import warnings warnings.filterwarnings("ignore")

grid = Grid.from_raster('roi.tif', data_name='dem') grid.fill_depressions(data='dem', out_name='flooded_dem') grid.resolve_flats('flooded_dem', out_name='inflated_dem')

dem = grid.view('inflated_dem')

rfsm = RFSM(dem)`

I will get an error in the last line, module 'skimage.morphology' has no attribute 'watershed'