Skip to content

Commit

Permalink
Don't fill unless we have a nodata value.
Browse files Browse the repository at this point in the history
Closes #237.
  • Loading branch information
Sean Gillies committed Jan 7, 2015
1 parent a073f61 commit 290184b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rasterio/_io.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,8 @@ cdef class RasterReader(_base.DatasetReader):
out = np.empty(win_shape, dtype)
for ndv, arr in zip(
self.nodatavals, out if len(win_shape) == 3 else [out]):
arr.fill(ndv)
if ndv is not None:
arr.fill(ndv)

# We can jump straight to _read() in some cases. We can ignore
# the boundless flag if there's no given window.
Expand Down

0 comments on commit 290184b

Please sign in to comment.