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)

Arguments

x
gt_RasterLayer.
y
gt_RasterLayer.
extent
logical should the objects' extent be compared? Defaults to TRUE.
rowcol
logical should the objects' dimensionality be compared? Defaults to TRUE.
crs
logical should the objects' coordinate refernece systems be compared?
res
logical should the objects' resolution be compared? Defaults to TRUE.
tolerance
numeric This sets the difference between values that is permissible for them to be considered equal. Defaults to 0.1.
stopiffalse
logical should an error be thrown if one or more conditions are not met?
showwarning
logical should a warning be thrown if one or more conditions are not met?

Value

logical are all tested parameters the same?

Details

This function is similar to compareRaster except that is is less rigorous.

Examples

## 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 ## ---------------------------------------------