Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Nov 25, 2023
1 parent fd34629 commit 7e5b732
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/resample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ include(joinpath(dirname(pathof(Rasters)), "../test/test_utils.jl"))

# Resample cea.tif using resample
cea = Raster(raster_path; missingval=0x00)
raster_output =
resample(cea; res=output_res, crs=output_crs, method)
raster_output = resample(cea; res=output_res, crs=output_crs, method)
disk_output = resample(cea; res=output_res, crs=output_crs, method, filename="resample.tif")

cea_permuted = permutedims(Raster(raster_path), (Y, X))
Expand Down Expand Up @@ -59,7 +58,7 @@ include(joinpath(dirname(pathof(Rasters)), "../test/test_utils.jl"))
@test cea == resampled
# There is some floating point error here after Rasters -> GDAL -> Rasterss...
# Should we correct it by detecting almost identical extent and using the original?
@test_broken extent(cea) = extent(resampled)
@test_broken extent(cea) == extent(resampled)
end

@testset "only `res` kw changes the array size predictably" begin
Expand All @@ -68,7 +67,7 @@ include(joinpath(dirname(pathof(Rasters)), "../test/test_utils.jl"))
@test crs(cea) == crs(resampled)
@test size(dims(resampled, (X, Y))) == size(dims(cea, (X, Y))) .* 2
# GDAL fp error see above
@test_broken extent(cea) = extent(resampled)
@test_broken extent(cea) == extent(resampled)
resampled = resample(cea; res=(res, 2res))
@test size(dims(resampled, (X, Y))) == (size(cea, X) .* 2, size(cea, Y))
resampled = resample(cea; res=(X(2res), Y(res)))
Expand Down

0 comments on commit 7e5b732

Please sign in to comment.