Closed gabrieldansereau closed 3 years ago
While at it, I added an ArgumentError in 1624f1a to prevent using hcat
and vcat
on non-contiguous layers.
Previously, this worked:
# Base layer
l1 = SimpleSDMPredictor(WorldClim, BioClim, 1; left=0.0, right=10.0, bottom=0.0, top=10.0)
# Non contiguous layers
l2 = SimpleSDMPredictor(WorldClim, BioClim, 1; left=0.0, right=10.0, bottom=20.0, top=30.0)
l3 = SimpleSDMPredictor(WorldClim, BioClim, 1; left=20.0, right=30.0, bottom=0.0, top=10.0)
vcat(l2, l1) # works
hcat(l1, l3) # works
Now it will throw:
julia> vcat(l2, l1)
ERROR: LoadError: ArgumentError: The two layers passed to vcat must have contiguous bottom and top coordinates
julia> hcat(l1, l3)
ERROR: LoadError: ArgumentError: The two layers passed to hcat must have contiguous left and right coordinates
hcat
andvcat
return inversed bottom & top bounding coordinates. Because of this, the results oflatitudes
(and other functions which depend on it) may be wrong. Somehow, this created a circular error and the tests still passed, but it is clearly not the intended behaviour.Example from the tests: