mdbartos / pysheds

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

error: _convert_grid_indices_crs() #121

Closed Libosch closed 2 years ago

Libosch commented 4 years ago

I tried to calculate cell_distances(), yet the calculated length did not make sense to me. It seems as if a bug occurred in the transformation of the raster coordinates: x and y coordinates are wrong.

After changing line 2174 from: x2, y2 = pyproj.transform(old_crs, new_crs, grid_indices[:,1], grid_indices[:,0]) to: x2, y2 = pyproj.transform(old_crs, new_crs, grid_indices[:,0], grid_indices[:,1])

the calculation worked

Best wishes and thank you for this great tool!

mdbartos commented 2 years ago

Greetings, this may be due to a change in the pyproj library and should be fixed in pysheds v0.3. Please reopen an issue if this problem persists.