You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using Rasters, NCDatasets
write("myfile.nc", Raster(rand(X(1:10), Y(1:10))))
write("myfile.nc", Raster(rand(X(2:10), Y(1:10)), name = :ras2), append = true)
RasterStack("myfile.nc")
The second write errors because the dimensions don't match, but before that error occurs the layer is already initalized, so we end up with an extra layer that is filled with 9.96921e36.
Probably we need a try-catch block and delete the layer again if an error occurs.
tiemvanderdeure
changed the title
Failing to append layer to netcfd still initializes the layer
Error when appending layer to netcdf still adds a layer to the file
May 12, 2025
MWE:
The second write errors because the dimensions don't match, but before that error occurs the layer is already initalized, so we end up with an extra layer that is filled with
9.96921e36
.Probably we need a try-catch block and delete the layer again if an error occurs.
The text was updated successfully, but these errors were encountered: