View source: R/functions_geographical.R
calculate_nominal_resolution | R Documentation |
Calculate "nominal resolution" of a grid
calculate_nominal_resolution(grid, maskvalue = NA)
grid |
A |
maskvalue |
A vector. Values to mask out from |
A character string with a "nominal resolution" value in kilometers.
CMIP6 Global Attributes, DRS, Filenames, Directory Structure, and CV’s, 10 September 2018 (v6.2.7). Appendix 2: Algorithms for Defining the "nominal_resolution" Attribute
r1 <- terra::rast(
xmin = -120, xmax = -90,
ymin = 30, ymax = 50,
crs = "OGC:CRS84",
resolution = c(0.5, 0.5)
)
xy <- terra::spatSample(r1, size = 200L, as.points = TRUE)
r1[xy] <- 1
calculate_nominal_resolution(r1)
calculate_nominal_resolution(stars::st_as_stars(r1))
r2 <- terra::rast(
xmin = -2480000, xmax = 90000,
ymin = 650000, ymax = 4020000,
crs = "EPSG:6350",
resolution = c(10000, 10000)
)
xy <- terra::spatSample(r2, size = 200L, as.points = TRUE)
r2[xy] <- 1
calculate_nominal_resolution(r2)
calculate_nominal_resolution(stars::st_as_stars(r2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.