View source: R/write_dataset.R
write_geo | R Documentation |
Write a spatial file with gdal
write_geo(
dataset,
path,
conn = cached_connection(),
driver = "GeoJSON",
layer_creation_options = "WRITE_BBOX=YES"
)
dataset |
a remote tbl object from |
path |
a local file path or S3 path with write credentials |
conn |
duckdbfs database connection |
driver |
driver, see https://duckdb.org/docs/stable/extensions/spatial/gdal |
layer_creation_options |
to GDAL, see https://duckdb.org/docs/stable/extensions/spatial/gdal |
NOTE: at this time, duckdb's pre-packaged GDAL does not support s3 writes, and will produce a "Error: Not implemented Error: GDAL Error (6): Seek not supported on writable /vsis3/ files". Use to_geojson() instead.
local_file <- system.file("extdata/spatial-test.csv", package="duckdbfs")
load_spatial()
tbl <- open_dataset(local_file, format='csv')
write_geo(tbl, "spatial.geojson")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.