Can't get the expected resolution using Rasters.resample

I tried the following code snippet to resample high-resolution data to a lower resolution. The first method works, but the second one doesn’t. It seems I missed some parameters for the “to” keyword in the resample function.

begin
	lon1,lat1 = X(-179.5:0.1:179.5), Y(-89.5:0.1:89.5)
	var1 = Raster(rand(lon1, lat1), crs=EPSG(4326))

	lon2,lat2 = X(-179.5:1:179.5), Y(-89.5:1:89.5)

#first method
	ref = Raster(rand(lon2, lat2))
	var2 = resample(var1; to=ref, crs=EPSG(4326), method="average")

#second method
	var3 = resample(var1; to=(X=lon2,Y=lat2), crs=EPSG(4326), method="average")
end

Yes its a little annoying that it swallows that and doesn’t tell you whats wrong.

Passing your dimensions just as a tuple is the solution, you dont need the NamedTuple. But that also doesn’t work at the moment!

I will make better error messages for this and fix the inputs, probably good to copy this to a github issue

yes, it’s done.