source_gpkg <- system.file("extdata", "clc.gpkg", package = "clc")
clo <- clc(source = source_gpkg, layer_name = "clc")
# ex1
out_gpkg <- tempfile(fileext = ".gpkg")
sink(tempfile())
clo <- clo |>
save_to(out_gpkg)
sink()
if (FALSE) {
# ex2
conn <- RPostgres::dbConnect(
RPostgres::Postgres(),
dbname = 'exampledb',
host = 'localhost',
port = '5432',
user = 'user',
password = 'password'
)
clo <- clo |>
save_to(conn, 'exampledb')
}
Run the code above in your browser using DataLab