Learn R Programming

lazysf (version 0.3.0)

st_as_sf: Force computation of a GDAL query

Description

Convert lazysf to an in memory data frame or sf object

Usage

# S3 method for tbl_SFSQLConnection
st_as_sf(x, ...)

collect(x, ...)

Value

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

Format

An object of class function of length 1.

Arguments

x

output of lazysf()

...

passed to collect()

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)

See Also

lazysf

Examples

Run this code
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