Evaluate whether two gt_RasterLayer
objects have the same
extent, number of rows and columns, projection, and resolution
(or a subset of these comparisons).
gt_compareRaster(x, y, extent = TRUE, rowcol = TRUE, crs = TRUE, res = TRUE, tolerance = 0.1, stopiffalse = TRUE, showwarning = FALSE)
gt_RasterLayer
.gt_RasterLayer
.logical
should the objects' extent be compared?
Defaults to TRUE
.logical
should the objects' dimensionality be compared?
Defaults to TRUE
.logical
should the objects' coordinate refernece systems
be compared?logical
should the objects' resolution be compared?
Defaults to TRUE
.numeric
This sets the difference between values
that is permissible for them to be considered equal. Defaults to 0.1.logical
should an error be thrown if one or
more conditions are not met?logical
should a warning be thrown if one or
more conditions are not met?logical
are all tested parameters the same?
This function is similar to compareRaster
except that is is less rigorous.
## Not run: ------------------------------------ # g <- gt_raster(raster::raster(matrix(runif(9), ncol=3), # crs=sp::CRS('+init=epsg:4326'), # xmn=0, xmx=3, ymn=2, ymx=10)) # g2 <- gt_raster(raster::raster(matrix(runif(9), ncol=3), # crs=sp::CRS('+init=epsg:3395'), # xmn=0, xmx=3, ymn=2, ymx=10)) # g3 <- gt_raster(raster::raster(matrix(runif(9), ncol=3), # crs=sp::CRS('+init=epsg:4326'), # xmn=10, xmx=13, ymn=12, ymx=20)) # gt_compareRaster(g, g) # same properties # gt_compareRaster(g, g2, stopiffalse=FALSE) # different crs # gt_compareRaster(g, g2, stopiffalse=FALSE) # different extent ## ---------------------------------------------