There are underlaps and overlaps when getTileExtent(x, SpatRaster) is used, presumably from rounding edge cases. In this example, attempting to break 95x90 into 2x2 tiles results in an overlapping column on the original data, and the same input reduce x4 to 24x23 results in an under-lap of one row.
(I appreciate that breaking into tiles of this nature is somewhat undefined in terms of how alignment and dangle should be handled and it's different for y = SpatRaster than y = numeric, but internal overlaps and underlaps should not occur afaict).
## overplot matrix of extents (cbind(xmin, xmax, ymin, ymax) as from getTileExtents)
rect_extent <- function(x, ...) {
rect(x[,1], x[,3], x[,2], x[,4], ...)
}
library(terra)
#> terra 1.7.78
There are underlaps and overlaps when
getTileExtent(x, SpatRaster)
is used, presumably from rounding edge cases. In this example, attempting to break 95x90 into 2x2 tiles results in an overlapping column on the original data, and the same input reduce x4 to 24x23 results in an under-lap of one row.(I appreciate that breaking into tiles of this nature is somewhat undefined in terms of how alignment and dangle should be handled and it's different for
y = SpatRaster
thany = numeric
, but internal overlaps and underlaps should not occur afaict).Created on 2024-07-18 with reprex v2.0.2
discovered with @njtierney