Skip to content

Commit

Permalink
Fix input shape since Rasterio 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Nov 8, 2024
1 parent b577e42 commit 62f7316
Showing 1 changed file with 6 additions and 0 deletions.
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.reshape(raster_arr)

return output


Expand Down

0 comments on commit 62f7316

Please sign in to comment.