Get the spatial resolution of a spatial object.

getRes(x, ...)

# S4 method for ANY
getRes(x)

# S4 method for geom
getRes(x)

# S4 method for Raster
getRes(x)

# S4 method for SpatRaster
getRes(x)

# S4 method for matrix
getRes(x)

Arguments

x

the object from which to derive the resolution.

...

other arguments.

Value

A vector of two values of the spatial resolution of x in x and y dimension.

See also

Examples


getRes(gtGeoms$grid$categorical)
#> [1] 1 1

gc_raster(gtGeoms$grid$categorical) %>%
  getRes()
#> [1] 1 1

gc_terra(gtGeoms$grid$categorical) %>%
  getRes()
#> [1] 1 1

getRes(x = matrix(0, 3, 5))
#> [1] 1 1