Don't fill masked output when reprojecting #3289
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#3156 added a
masked
argument torasterio.warp.reproject
:rasterio/rasterio/warp.py
Lines 254 to 255 in 64474c1
I tried calling
rasterio.warp.reproject
withmasked=True
, without passing a destination array. The documentation above suggests the output should be a masked array, but it's not. Reading through the code, it looks like a masked array is created but then immediately filled in:rasterio/rasterio/warp.py
Line 385 in 64474c1
I tried removing the
.filled(dst_nodata)
. The tests pass when I run them locally. I added a small test to check that the output is a masked array.