st_as_sf: Force computation of a GDAL query

Description Usage Arguments Format Details Value See Also Examples

Description

Convert lazysf to an in memory data frame or sf object

Usage

1
2
3
4
## S3 method for class 'tbl_SFSQLConnection'
st_as_sf(x, ...)

collect(x, ...)

Arguments

x

output of lazysf()

...

passed to collect()

Format

An object of class function of length 1.

Details

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)

Value

a data frame from collect(), sf data frame from st_as_sf() (only if it contains an sfc geometry column)

See Also

lazysf

Examples

1
2
3
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)

lazysf documentation built on Nov. 14, 2020, 9:07 a.m.