% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vect.R
\name{vect,dbSpatial-method}
\alias{vect,dbSpatial-method}
\title{Create SpatVector objects}
\usage{
\S4method{vect}{dbSpatial}(x, select = tidyselect::everything(), ...)
}
\arguments{
\item{x}{A \code{\link{dbSpatial}} object to convert into a \code{\link[terra:SpatVector-class]{terra::SpatVector}} object}

\item{select}{Columns to retain in output (default: all columns)}

\item{...}{Additional arguments passed to \code{\link[sf:st_as_sf]{sf::st_as_sf}}}
}
\value{
A \code{\link[terra:SpatVector-class]{terra::SpatVector}} containing the selected columns and geometry
materialized from \code{x}.
}
\description{
Create SpatVector objects
}
\examples{
\donttest{
if (interactive() && requireNamespace("duckdb", quietly = TRUE)) {
  point_data <- data.frame(x = c(100, 200), y = c(500, 600), id = 1:2)
  point_vect <- terra::vect(point_data, geom = c("x", "y"))
  duckdb_conn <- DBI::dbConnect(duckdb::duckdb(), ":memory:")
  DBI::dbExecute(duckdb_conn, "SET threads = 1")
  dbs <- as_dbSpatial(point_vect, conn = duckdb_conn, name = "point_vect",
                      overwrite = TRUE)
  terra::vect(dbs)
  DBI::dbDisconnect(duckdb_conn, shutdown = TRUE)
}
}

}
\seealso{
Other dbSpatial: 
\code{\link{as_dbSpatial}()},
\code{\link{dbSpatial}},
\code{\link{show,dbSpatial-method}},
\code{\link{st_as_sf.dbSpatial}()}
}
\concept{dbSpatial}
