Check alignment of a spatial layer against a reference grid
Source:R/check_alignment.R
check_alignment.RdTests whether x shares the same CRS, extent, resolution, and
origin as ref. A named logical vector is returned (invisibly)
with one element per property. Mismatches trigger an informative
message so callers can decide whether to harmonize before
proceeding.
Usage
check_alignment(x, ref = ab_grid(), tol = 1e-06, verbose = TRUE)Arguments
- x
A
SpatRaster(terra) orsfobject to check.- ref
A
SpatRasterused as the reference grid. Defaults to the ABMI 1 km Alberta grid,ab_grid().- tol
Numeric tolerance used for extent, resolution, and origin comparisons. Defaults to
1e-6.- verbose
Logical; if
TRUE(default), messages are printed for each property.