Determine if GRasters and/or GVectors are geographically comparable
Source:R/compareGeom.r
compareGeom.Rd
compareGeom()
compares geographic metadata between two or more GRaster
s and/or GVector
s. In many cases, spatial objects must be comparable for them to "interact" (e.g., conducting arithmetic operations, masking, etc.).
Usage
# S4 method for class 'GRaster,GRaster'
compareGeom(
x,
y,
...,
location = TRUE,
mapset = TRUE,
topo = TRUE,
lyrs = FALSE,
crs = TRUE,
ext = TRUE,
zext = TRUE,
rowcol = TRUE,
depths = TRUE,
res = TRUE,
zres = TRUE,
stopOnError = TRUE,
messages = TRUE
)
# S4 method for class 'GVector,GVector'
compareGeom(
x,
y,
...,
location = TRUE,
mapset = TRUE,
topo = FALSE,
crs = TRUE,
ext = FALSE,
zext = FALSE,
geometry = FALSE,
stopOnError = TRUE,
messages = TRUE
)
# S4 method for class 'GRaster,GVector'
compareGeom(
x,
y,
...,
location = TRUE,
mapset = TRUE,
topo = FALSE,
crs = TRUE,
ext = FALSE,
zext = FALSE,
stopOnError = TRUE,
messages = TRUE
)
# S4 method for class 'GVector,GRaster'
compareGeom(
x,
y,
...,
location = TRUE,
mapset = TRUE,
topo = FALSE,
crs = TRUE,
ext = FALSE,
zext = FALSE,
stopOnError = TRUE,
messages = TRUE
)
Arguments
- x, y, ...
GRaster
s orGVector
s. Ify
isGRaster
, then the...
must also beGRaster
s (or missing). Ify
isGVector
, then the...
must also beGVector
s (or missing).- location, mapset
Logical: Compare GRASS "project/location" and "mapsets" (see
vignette("projects_mapsets", package = "fasterRaster")
). Default isTRUE
.- topo
Logical: Test for same topology (2D or 3D). By default, this is
TRUE
for raster-raster comparisons, andFALSE
for all others.- lyrs
Logical (rasters only): Compare number of layers of "stacked" rasters. Note this is different from number of vertical "depths" of a raster. Default is
FALSE
.- crs
Logical: Compare coordinate reference systems. Default is
TRUE
.- ext
Logical: If
TRUE
, test for same extent. By default, isTRUE
for raster-raster comparison andFALSE
for all others.- zext
Logical: Test for same vertical extents (3D only). By default, this is
TRUE
for raster-raster comparisons, andFALSE
for all others.- rowcol
Logical (rasters only): Test for same number of rows and columns. Default is
TRUE
.- depths
Logical (rasters only): Test for same number of depths. Default is
TRUE
.- res
Logical (rasters only): Test for same resolution in x- and y-dimensions. Default is
TRUE
.- zres
Logical (rasters only): Test for same resolution in z dimension. Default is
TRUE
.- stopOnError
Logical: If
TRUE
(default), throw an error with an explanation if the objects are not comparable. IfFALSE
(default), returnTRUE
orFALSE
.- messages
Logical: If
TRUE (default), display a warning if a condition is not met. This only comes into effect if
stopOnErroris
FALSE`.- geometry
Logical (vector-vector comparison only): Compare geometry. Default is
FALSE
.