Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

compareGeom

Compare geometries of SpatRasters


Description

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

Usage

## S4 method for signature 'SpatRaster,SpatRaster'
compareGeom(x, y, ..., lyrs=FALSE, 
          crs=TRUE, warncrs=FALSE, ext=TRUE, rowcol=TRUE, res=FALSE)

Arguments

x

SpatRaster

y

SpatRaster

...

Additional SpatRasters

lyrs

logical. If TRUE, the number of layers is compared

crs

logical. If TRUE, coordinate reference systems are compared

warncrs

logical. If TRUE, a warning is given if the crs is different (instead of an error)

ext

logical. If TRUE, bounding boxes are compared

rowcol

logical. If TRUE, number of rows and columns of the objects are compared

res

logical. If TRUE, resolutions are compared (redundant when checking extent and rowcol)

Examples

r1 <- rast()
r2 <- rast()
r3 <- rast()
compareGeom(r1, r2, r3)
nrow(r3) <- 10

## Not run: 
compareGeom(r1, r3)

## End(Not run)

terra

Spatial Data Analysis

v1.2-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut] (<https://orcid.org/0000-0001-5872-2872>), Roger Bivand [ctb] (<https://orcid.org/0000-0003-2392-6140>), Karl Forner [ctb], Jeroen Ooms [ctb] (<https://orcid.org/0000-0002-4035-0289>), Edzer Pebesma [ctb] (<https://orcid.org/0000-0001-8049-7069>)
Initial release
2021-05-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.