Read a Parquet file to sf object
st_read_parquet.RdRead a Parquet file. Uses standard metadata information to identify geometry columns and coordinate reference system information.
Arguments
- dsn
character file path to a data source
- col_select
A character vector of column names to keep. Default is
NULLwhich returns all columns- props
Now deprecated in
read_parquet.- ...
additional parameters to pass to
ParquetFileReader
Value
object of class sf
Details
Reference for the metadata used:
https://github.com/geopandas/geo-arrow-spec. These are standard with
the Python GeoPandas library.
Examples
# load Natural Earth low-res dataset.
# Created in Python with GeoPandas.to_parquet()
path <- system.file("extdata", package = "sfarrow")
world <- st_read_parquet(file.path(path, "world.parquet"))
#> Error in metadata$columns[[col]]$crs$id: $ operator is invalid for atomic vectors
world
#> Error: object 'world' not found
plot(sf::st_geometry(world))
#> Error: object 'world' not found