Closed BG-AIMS closed 3 months ago
Could you please copy the whole stacktrace?
The problem is you are using symbols for the dimensions instead of the dimension types like X, Y and Ti see this part of the DimensionalData documentation: https://rafaqz.github.io/DimensionalData.jl/dev/dimensions
If you replace your dimensions with X, Y and Ti the writing of the tif file works as expected.
using Rasters, ArchGDAL
A = Raster(rand(10,10,10), (X, Y, Ti))
xt = dropdims(mean(A, dims=Ti), dims=Ti)
write("test.tif", Xt)
You can also use Symbols, but they have to be uppercase - those will be converted to the types X and Y. We need to know which dimensions relate to gdals X and Y dimensions and uppercase X/Y is our convention.
@dim x XDim
@dim y YDim
May help too, but may not work everywhere.
Thanks for the help. It works after renaming x and y to uppercase dimensions and avoiding symbols.
I'm experiencing an issue when reducing a raster from 3 to 2 dimensions with
mean()
, the reduced dimension becomes a reference dimension. Then when trying to write this to .tif file it gives the errorMethodError: no method matching lookup(::Nothing)
Here is an example:
Same error when not using dropdims() as well.