mdbartos / pysheds

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

RFSM problem #200

Open Wytsepetrie opened 2 years ago

Wytsepetrie commented 2 years ago

Hello @mdbartos The pysheds package is very usefull, so thank you! At the moment I am trying to use the RFSM. I already fixed the depressions and flats of my DEM. When I am using RFSM over the inflated DEM, the following error happens:

Do you have any idea, what maybe went wrong?

`C:\Users\wytse\anaconda3\lib\site-packages\skimage\morphology_deprecated.py:5: skimage_deprecation: Function watershed is deprecated and will be removed in version 0.19. Use skimage.segmentation.watershed instead. def watershed(image, markers=None, connectivity=1, offset=None, mask=None,

AttributeError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_17896/1322432168.py in ----> 1 rfsm = RFSM(inflated_dem)

~\anaconda3\lib\site-packages\pysheds\rfsm.py in init(self, dem, max_levels, max_spills, min_size, boundary) 21 self.size = dem.size 22 self.exit_node = Node(name='exit', vol=np.inf, cumulative_vol=np.inf) ---> 23 self.construct_topology() 24 25 def construct_topology(self):

~\anaconda3\lib\site-packages\pysheds\rfsm.py in construct_topology(self) 27 self.find_hierarchy() 28 self.find_watersheds() ---> 29 self.find_connections() 30 self.find_drop() 31 self.create_tree()

~\anaconda3\lib\site-packages\pysheds\rfsm.py in find_connections(self) 145 comm = np.flatnonzero((self.ws[index] == 0) & inside) 146 # TODO: Not super elegant --> 147 neighbors = self.ws[index].flat[Grid._select_surround_ravel(self, comm, 148 self.ws[index].shape)] 149 comms = dict(zip(comm, [set() for i in comm]))

AttributeError: type object 'sGrid' has no attribute '_select_surround_ravel'`

AlvaroProsperia commented 1 year ago

Hello @mdbartos. Thank you for the amazing package. I am facing the same issue as the above post.

Chetan5276 commented 10 months ago

Hi @mdbartos, thank you for great package. I'm using this packages for sometime and I'm also facing similar issue as above. Can you please help me with this error. Thank you. Screenshot from 2023-10-09 14-17-09

epee79 commented 5 months ago

hello, I'm facing a similar issues. Has anyone solved it yet?

AttributeError: 'sGrid' object has no attribute 'dem'