powered by
Convert lazysf to an in memory data frame or sf object
# S3 method for tbl_SFSQLConnection st_as_sf(x, ...)collect(x, ...)
collect(x, ...)
a data frame from collect(), sf data frame from st_as_sf() (only if it contains an sfc geometry column)
collect()
st_as_sf()
sfc
An object of class function of length 1.
function
output of lazysf()
lazysf()
passed to collect()
collect() retrieves data into a local table, preserving grouping and ordering.
st_as_sf() retrieves data into a local sf data frame (will succeed only if there is a geometry column of class sfc)
lazysf
f <- system.file("gpkg/nc.gpkg", package = "sf", mustWork = TRUE) lsf <- lazysf(f) %>% dplyr::select(AREA, FIPS, geom) %>% dplyr::filter(AREA < 0.1) st_as_sf(lsf)
Run the code above in your browser using DataLab