mdbartos / pysheds

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

My QGis Exported DEM's get an attribute error #134

Closed Trevy05 closed 3 years ago

Trevy05 commented 3 years ago

The 1 arc-second DEM's work fine, but after clipping and exporting a smaller part of my DEM, I get this attribute error. Is there any way I could clip a DEM without this issue?

AttributeError Traceback (most recent call last)

in ----> 1 grid = Grid.from_raster('C:/Users/18683/Desktop/Datasets/DEM/DEM.tif', data_name='dem') ~\miniconda3\lib\site-packages\pysheds\grid.py in from_raster(cls, path, data_name, **kwargs) 315 def from_raster(cls, path, data_name, **kwargs): 316 newinstance = cls() --> 317 newinstance.read_raster(path, data_name, **kwargs) 318 return newinstance 319 ~\miniconda3\lib\site-packages\pysheds\grid.py in read_raster(self, data, data_name, band, window, window_crs, metadata, **kwargs) 274 shape = f.shape 275 if len(f.indexes) > 1: --> 276 data = np.ma.filled(f.read_band(band)) 277 else: 278 data = np.ma.filled(f.read()) AttributeError: 'DatasetReader' object has no attribute 'read_band'