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
This means getmask has swapped X and Y dimensions. Fortunately, the ext(1:2) refers to Y and ext(3:4) refers to X, so the error corrects itself. But I suggest returning ext = [min(y) max(y) min(x) max(x)]; in getextent and call getextent(c,r) in getmask.
The text was updated successfully, but these errors were encountered:
Hi @oejwing
well spotted ;-). I agree that the naming of the variables in getextent is confusing, and x and should be renamed to row and y should be col. I will change this because otherwise, this really makes reading the code difficult. In the end, it doesn't produce an error.
In the end, it is the order to which we are used to and which is confusing: lat lon, x y, row col...
Cheers, Wolfgang
In
getmask
,getextent
is called with the order of the arguments being row/lat/y first and col/lon/x second.topotoolbox/@GRIDobj/polygon2GRIDobj.m
Line 240 in 21c93eb
However,
getextent
requires the order to the opposite.topotoolbox/@GRIDobj/polygon2GRIDobj.m
Lines 272 to 275 in 21c93eb
This means
getmask
has swapped X and Y dimensions. Fortunately, theext(1:2)
refers to Y andext(3:4)
refers to X, so the error corrects itself. But I suggest returningext = [min(y) max(y) min(x) max(x)];
ingetextent
and callgetextent(c,r)
ingetmask
.The text was updated successfully, but these errors were encountered: