An sf::st_write() method (also reached through sf::write_sf()) for a
vectra_node: writes the result a batch at a time, appending each, so the
whole layer is never held in memory. This is the streaming counterpart to
collect_sf(x) |> sf::st_write(...) – that route materializes every feature
as an sf object first, which for a multi-million-feature result dominates
memory; this route's peak is one batch.
Usage
# S3 method for class 'vectra_node'
st_write(
obj,
dsn,
layer = NULL,
...,
geom = "geometry",
crs = NULL,
delete_dsn = FALSE,
quiet = TRUE
)Arguments
- obj
A
vectra_nodewhose rows carry a hex-WKB geometry column (fromspatial_overlay(), a groupedslice_min()/slice_max()resolution, a.vtrscan, ...). It is consumed by the stream.- dsn
Destination data source name (file path).
- layer
Layer name.
NULLlets sf derive it fromdsn.- ...
Unused; for S3 generic compatibility.
- geom
Name of the hex-WKB geometry column. Default
"geometry".- crs
CRS to tag the output with.
NULLtakes the CRS carried on the node.- delete_dsn
If
TRUE, remove an existingdsnbefore writing.- quiet
Passed to
sf::st_write().
See also
collect_sf() to materialize the whole result as one sf object.