View source: R/read_write_idf.r
read_raster | R Documentation |
The function 'read_raster' is able to create a terra::SpatRaster object from an idf-file if an idf-filename is specified (exctension '.idf', like in 'foo.idf'). Otherwhise the function equals the function 'terra::rast()'.
read_raster(x, EPSG = "EPSG:28992", e = NULL, funstr = NULL, ...)
x |
filename (character) |
EPSG |
coordinate reference system like "EPSG:4326" (character) |
e |
Terra extent object |
funstr |
Optional function to modify raster values. Denote the raster with 'x' (or character between square brackets) (character) |
... |
Additional arguments as for 'terra::rast' function. For an idf-raster, only the optional 'EPSG' argument is used. |
terra::SpatRaster
f <- system.file("extdata", "test.idf", package="idf")
r <- read_raster(f)
f <- system.file("extdata", "test.tif", package="idf")
r <- read_raster(f)
f <- system.file("extdata", "heads.tif", package="idf")
r <- read_raster(f)
names(r)
f1 <- system.file("extdata", "HEAD_20080401_l1.idf", package="idf")
f2 <- system.file("extdata", "HEAD_20080501_l1.idf", package="idf")
f <- c(f1, f2)
r <- read_raster(f)
r <- read_raster(f, funstr="x*100")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.