Skip to content

Commit

Permalink
Unpin Rasterio<1.4 now that 2D xy/rowcol fixed (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet authored Nov 8, 2024
1 parent 721a01a commit 5d4cd2f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dev-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- numpy=1.*
- matplotlib=3.*
- pyproj>=3.4,<4
- rasterio>=1.3,<1.4
- rasterio>=1.3,<2
- scipy=1.*
- tqdm
- scikit-image=0.*
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- numpy=1.*
- matplotlib=3.*
- pyproj>=3.4,<4
- rasterio>=1.3,<1.4
- rasterio>=1.3,<2
- scipy=1.*
- tqdm
- scikit-image=0.*
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ numba==0.*
numpy==1.*
matplotlib==3.*
pyproj>=3.4,<4
rasterio>=1.3,<1.4
rasterio>=1.3,<2
scipy==1.*
tqdm
scikit-image==0.*
Expand Down
6 changes: 6 additions & 0 deletions xdem/coreg/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,8 @@ def _reproject_horizontal_shift_samecrs(
# force any pixel interpretation (area_or_point) without it having any influence on the result, here "Area"
if not return_interpolator:
coords_dst = _coords(transform=dst_transform, area_or_point="Area", shape=raster_arr.shape)
# Flatten the arrays (only 1D supported in rowcol/xy after Rasterio 1.4)
coords_dst = (coords_dst[0].ravel(), coords_dst[1].ravel())
# If we just want the interpolator, we don't need to coordinates of destination points
else:
coords_dst = None
Expand All @@ -1327,6 +1329,10 @@ def _reproject_horizontal_shift_samecrs(
return_interpolator=return_interpolator,
)

# Reshape output
if coords_dst is not None:
output = output.reshape(np.shape(raster_arr))

return output


Expand Down

0 comments on commit 5d4cd2f

Please sign in to comment.