Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpin Rasterio<1.4 now that 2D xy/rowcol fixed #615

Merged
merged 5 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading