st_write_parquet {sfarrow} | R Documentation |
Write sf
object to Parquet file
Description
Convert a simple features spatial object from sf
and
write to a Parquet file using write_parquet
. Geometry
columns (type sfc
) are converted to well-known binary (WKB) format.
Usage
st_write_parquet(obj, dsn, ...)
Arguments
obj |
object of class |
dsn |
data source name. A path and file name with .parquet extension |
... |
additional options to pass to |
Value
obj
invisibly
See Also
Examples
# read spatial object
nc <- sf::st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
# create temp file
tf <- tempfile(fileext = '.parquet')
on.exit(unlink(tf))
# write out object
st_write_parquet(obj = nc, dsn = tf)
# In Python, read the new file with geopandas.read_parquet(...)
# read back into R
nc_p <- st_read_parquet(tf)
[Package sfarrow version 0.4.1 Index]