-
Notifications
You must be signed in to change notification settings - Fork 529
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
WarpedVRT resampling behavior #1206
Comments
👋 @ungarj can you try to add the resampling method to the |
That was the trick, thanks! I must have been quite blind yesterday to not try this out. It was a bit confusing though because the WarpedVRT object also has a resampling attribute. |
One sidenote: adding |
@vincentsarago resampling seems to fall back to |
Ok, I did a little bit of digging: Shouldn't here be the On my local build adding it seems to work. I'm not sure though whether it's the cleanest fix because I'm not familiar enough with rasterio's internals. Here is what I suspect: without It seems it is intended that the Not sure how to solve that in a clean way. One option would be the solution mentioned above but this means the In any case the documentation should reflect the correct usage whether to use I can prepare a PR with the proposed changes if you want. |
@vincentsarago done: #1238 |
@ungarj I added a long comment at #1238 and will follow up here, too. The case of a boundless read from a Rasterio's |
👋 here is another demonstration of import rasterio
src = rasterio.open('s3://remotepixel/data/image/LC82330572016015LGN00.tif')
data_expected = src.read(1, window=((0,100), (0,100)), resampling=Resampling.bilinear)
# Reading the data with boundless=True, resampling=Resampling.bilinear
data_boundless = src.read(1, window=((-100,100), (-100,100)), boundless=True, resampling=Resampling.bilinear)
# Reading the data withing the image bounds
data_inBounds = src.read(1, window=((0,100), (0,100)), boundless=True, resampling=Resampling.bilinear)
https://gist.github.com/vincentsarago/a58c088c7f7de6fd0806a2ba0106e147 cc @sgillies |
This one has been closed in 1.0b4. |
WarpedVRT
shows unexpected behavior when using other resampling methods thanResampling.nearest
.Expected behavior and actual behavior.
Resampling.bilinear
returns the same output thanResampling.nearest
. However, when resampling with GDAL, the output image is smoothed.GDAL bilinear:
Resampling.nearest
:Resampling.bilinear
:Steps to reproduce the problem.
Here is a zip file containing the example data (a CleanTOPO extract) and the script that reproduces all outputs: warpedvrt_resampling.zip
this is the code snipped that reads and resamples the window:
Not sure whether I used all of the parameters correctly. I used the example from the docs.
Operating system
Ubuntu 16.04
Rasterio version and provenance
1.0a11 installed from PyPI using pip 9.0.1, using Python 2.7
The text was updated successfully, but these errors were encountered: