st_write.vectra_node: Stream a vectra node's geometry to a vector file

View source: R/spatial.R

st_write.vectra_nodeR Documentation

Stream a vectra node's geometry to a vector file

Description

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_node whose rows carry a hex-WKB geometry column (from spatial_overlay(), a grouped slice_min() / slice_max() resolution, a .vtr scan, ...). It is consumed by the stream.

dsn

Destination data source name (file path).

layer

Layer name. NULL lets sf derive it from dsn.

...

Unused; for S3 generic compatibility.

geom

Name of the hex-WKB geometry column. Default "geometry".

crs

CRS to tag the output with. NULL takes the CRS carried on the node.

delete_dsn

If TRUE, remove an existing dsn before writing.

quiet

Passed to sf::st_write().

Value

The dsn, invisibly.

See Also

collect_sf() to materialize the whole result as one sf object.


vectra documentation built on July 10, 2026, 5:08 p.m.