dbConnect for drawings that may be read by package sf
# S4 method for SFSQLDriver dbConnect(drv, DSN = "", readonly = TRUE, ...)
drv | SFSQLDriver created by |
---|---|
DSN | data source name, may be a file, or folder path, database connection string, or URL |
readonly | open in readonly mode ( |
... | ignored |
The 'OGRSQL' available is documented with GDAL: https://gdal.org/user/ogr_sql_dialect.html
afile <- system.file("gpkg/nc.gpkg", package = "sf", mustWork = TRUE) db <- dbConnect(SFSQL(), afile) dbSendQuery(db, 'SELECT * FROM "nc.gpkg"')#> Field names: AREA, PERIMETER, CNTY_, CNTY_ID, NAME, FIPS, FIPSNO, CRESS_ID, BIR74, SID74, NWBIR74, BIR79, SID79, NWBIR79, geom