diff --git a/hydromt/raster.py b/hydromt/raster.py index 60d769dd1..90a4bbe9e 100644 --- a/hydromt/raster.py +++ b/hydromt/raster.py @@ -2402,8 +2402,7 @@ def tile_window(zl, minx, miny, maxx, maxy): temp = obj[u : u + h, l : l + w] - tile = np.empty((px_size, px_size), np.float64) - tile[:] = nodata + tile = np.full((px_size, px_size), nodata, dtype=np.float64) temp_transform = Affine( obj_res, @@ -2438,7 +2437,7 @@ def tile_window(zl, minx, miny, maxx, maxy): transform[0], )[:px_size], }, - data=tile, + data=tile.copy(), ) del tile