if (FALSE) {
## load packages
library(duckspatial)
library(sf)
## read data
argentina_sf <- st_read(system.file("spatial/argentina.geojson", package = "duckspatial"))
# option 1: passing sf objects
ddbs_bbox(argentina_sf)
## option 2: passing the names of tables in a duckdb db
# creates a duckdb write sf to it
conn <- duckspatial::ddbs_create_conn()
ddbs_write_vector(conn, argentina_sf, "argentina_tbl", overwrite = TRUE)
output2 <- ddbs_bbox(
conn = conn,
x = "argentina_tbl",
name = "argentina_bbox"
)
DBI::dbReadTable(conn, "argentina_bbox")
}
Run the code above in your browser using DataLab