gt_compareRaster: Compare geotrellis raster objects

Description Usage Arguments Details Value Examples

View source: R/gt_compareRaster.R

Description

Evaluate whether two gt_RasterLayer objects have the same extent, number of rows and columns, projection, and resolution (or a subset of these comparisons).

Usage

1
2
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?

Details

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

Value

logical are all tested parameters the same?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## 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

## End(Not run)

jeffreyhanson/geotrellis documentation built on May 19, 2019, 4 a.m.