Get fallback nodata value from dest.

This commit is contained in:
Sean Gillies 2015-01-08 12:38:57 -07:00
parent 9cd3cc049f
commit e08fb78754

View File

@ -39,7 +39,7 @@ def merge(ctx, files, driver):
dest = np.zeros((first.count,) + first.shape,
dtype=first.dtypes[0])
nodataval = 0.0
nodataval = next(dest.flat)
if os.path.exists(output):
dst = rasterio.open(output, 'r+')
nodataval = dst.nodatavals[0] or nodataval