Open spono opened 6 months ago
I cannot reproduce this. Perhaps because of a difference in memory availability. But before I dig deeper, can you confirm that this problem persists for you? Specifically, I would expect xm
to be incorrect:
library(terra)
shp = vect("raster_mask.shp")
x = rast("raster_0.5m.tif")
xm = mask(x, shp, inverse=TRUE)
Or at least different from
r = rast("raster_1m.tif")
rm = mask(r, shp, inverse=TRUE)
Can you confirm that?
yep: the 1m resolution is ok and the 0.5 is not (tested on both 1.7.71
and 1.7.78
).
BTW, on my side, the available memory is 32 Gb, so it would seem pretty strange to me.
anything else I can provide for helping?
I had the chance to test it on another W10 machine using terra 1.7-3
on R 4.2.2
and it worked pretty fine. Nevertheless, updating to 1.7-71
that machine too showed the abovementioned bug.
Any idea about what else I can test?
Hi, dealing with an analysis over a wide area (few squared km), I need to mask some objects making use of the option
inverse=TRUE
. If I use a 1 metre resolution raster I get what I’m looking for but, in the case of a 0.5 m resolution (20033 x 33316 cells), the result is equal to the input layer. Just in case, I tried to check the CRS and the topology of the vector layer (provided as a SpatVector) but both are ok. Any other idea?Here the layers and below the code for testing:
I'm working with
terra 1.7.71
andR 4.3.2
on W10.