You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where it is clear that some integer values have been interpolated as the values 3 and 4.
Expected behavior
The excpected behaviour should be to apply the Resampling.nearest interpolation as requested. In fact, by looking at the code in the stack_rasters function, it seems that the resampling_method is ignored when performing the reprojection:
# Reproject to reference grid
reprojected_raster = raster.reproject(
bounds=dst_bounds,
res=reference_raster.res,
crs=reference_raster.crs,
dtype=reference_raster.data.dtype,
nodata=reference_raster.nodata,
silent=True,
resampling=resampling_method, # THE RESAMPLING METHOD IS MISSING
)
System:
OS: WSL2 on Windows 11
Environment: venv installed via pip
Additional context
No additional context to specify. I would just like to thank the maintainers of this repo. It is really useful when working on geospatial data and I hope it will get even more recognition.
The text was updated successfully, but these errors were encountered:
Thanks @axeldolce!
Indeed, it looks that it was as simple as passing the resampling method to the function. I added new tests in test_multiraster inspired by your example above to ensure this is now working fully with that change 🙂 in #601.
After review from other maintainers, I'll publish a new release with this bug fix.
Describe the bug
The stack_rasters function performs an interpolation of integer types even when the Resampling.nearest method is specified.
To Reproduce
To reproduce the behaviour one needs two integer Rasters with different bounds. Here is an example:
This will print out
where it is clear that some integer values have been interpolated as the values 3 and 4.
Expected behavior
The excpected behaviour should be to apply the Resampling.nearest interpolation as requested. In fact, by looking at the code in the stack_rasters function, it seems that the resampling_method is ignored when performing the reprojection:
System:
Additional context
No additional context to specify. I would just like to thank the maintainers of this repo. It is really useful when working on geospatial data and I hope it will get even more recognition.
The text was updated successfully, but these errors were encountered: