View source: R/ddbs_extent_funs.R
| ddbs_bbox | R Documentation |
Returns the minimal rectangle that encloses the geometry
ddbs_bbox(
x,
by_feature = FALSE,
conn = NULL,
name = NULL,
mode = NULL,
overwrite = FALSE,
quiet = FALSE
)
x |
Input spatial data. Can be:
Data is returned from this object. |
by_feature |
Logical. If |
conn |
A connection object to a DuckDB database. If |
name |
A character string of length one specifying the name of the table,
or a character string of length two specifying the schema and table
names. If |
mode |
Character. Controls the return type. Options:
Can be set globally via |
overwrite |
Boolean. whether to overwrite the existing table if it exists. Defaults
to |
quiet |
A logical value. If |
A bbox numeric vector with by_feature = FALSE
A data.frame or lazy tbl when by_feature = TRUE
## Not run:
## load packages
library(duckspatial)
## read data
argentina_ddbs <- ddbs_open_dataset(
system.file("spatial/argentina.geojson",
package = "duckspatial")
)
# option 1: passing sf objects
ddbs_bbox(argentina_ddbs)
## 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_table(conn, argentina_ddbs, "argentina_tbl", overwrite = TRUE)
output2 <- ddbs_bbox(
conn = conn,
x = "argentina_tbl",
name = "argentina_bbox"
)
DBI::dbReadTable(conn, "argentina_bbox")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.