# \donttest{
# Get a SpatRaster
r <- system.file("extdata/volcano2.tif", package = "tidyterra") |>
terra::rast() |>
terra::project("EPSG:4326")
r_tidy <- tidy(r)
r_tidy
# Back to a SpatRaster with
as_spatraster(r_tidy)
# SpatVector
cyl <- terra::vect(system.file("extdata/cyl.gpkg", package = "tidyterra"))
cyl
tidy(cyl)
# SpatExtent
ex <- cyl |> terra::ext()
ex
tidy(ex)
# With crs
tidy(ex, crs = pull_crs(cyl))
# SpatGraticule
grat <- terra::graticule(60, 30, crs = "+proj=robin")
grat
tidy(grat)
# }
Run the code above in your browser using DataLab