% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/duckspatial_df_dplyr_methods.R,
%   R/duckspatial_df_sf_methods.R
\name{collect.duckspatial_df}
\alias{collect.duckspatial_df}
\alias{ddbs_collect}
\title{Collect a duckspatial_df with flexible output formats}
\usage{
\method{collect}{duckspatial_df}(x, ..., as = NULL)

ddbs_collect(x, ..., as = c("sf", "tibble", "raw", "geoarrow"))
}
\arguments{
\item{x}{A \code{duckspatial_df} object}

\item{...}{Additional arguments passed to \code{collect}}

\item{as}{Output format. One of:
\describe{
\item{\code{"sf"}}{(Default) Returns an \code{sf} object with \code{sfc} geometry}
\item{\code{"tibble"}}{Returns a tibble with geometry column dropped (fastest)}
\item{\code{"raw"}}{Returns a tibble with geometry as raw WKB bytes}
\item{\code{"geoarrow"}}{Returns a tibble with geometry as \code{geoarrow_vctr}}
}}
}
\value{
Collected data in the specified format

Data in the specified format
}
\description{
Materializes a lazy \code{duckspatial_df} object by executing the underlying
DuckDB query. Supports multiple output formats.
}
\examples{
\dontrun{
library(duckspatial)

# Load lazy spatial data
nc <- ddbs_open_dataset(system.file("shape/nc.shp", package = "sf"))

# Perform lazy operations
result <- nc |> dplyr::filter(AREA > 0.1)

# Collect to sf (default)
result_sf <- ddbs_collect(result)
plot(result_sf["AREA"])

# Collect as tibble without geometry (fast)
result_tbl <- ddbs_collect(result, as = "tibble")

# Collect with raw WKB bytes
result_raw <- ddbs_collect(result, as = "raw")

# Collect as geoarrow for Arrow workflows
result_ga <- ddbs_collect(result, as = "geoarrow")
}
}
