% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generics.R, R/constructors.R
\name{st_as_geojson}
\alias{st_as_geojson}
\alias{st_as_geojson.dbSpatial}
\title{Convert to GeoJSON}
\usage{
st_as_geojson(x, ...)

\method{st_as_geojson}{dbSpatial}(x, ...)
}
\arguments{
\item{x}{\code{\link{dbSpatial}} object}

\item{...}{additional arguments}
}
\value{
\code{\link{dbSpatial}} object with GeoJSON column
}
\description{
Returns the GeoJSON representation of the geometry.
}
\section{Functions}{
\itemize{
\item \code{st_as_geojson(dbSpatial)}: Method for \code{dbSpatial} objects

}}
\examples{
\donttest{
if (interactive() && requireNamespace("duckdb", quietly = TRUE)) {
  point <- sf::st_sf(id = 1, geom = sf::st_sfc(sf::st_point(c(1, 2))))
  duckdb_conn <- DBI::dbConnect(duckdb::duckdb(), ":memory:")
  DBI::dbExecute(duckdb_conn, "SET threads = 1")
  x <- as_dbSpatial(point, conn = duckdb_conn, name = "point",
                    overwrite = TRUE)
  st_as_geojson(x)
  DBI::dbDisconnect(duckdb_conn, shutdown = TRUE)
}
}
}
\seealso{
Other constructors: 
\code{\link{st_as_text}()}
}
\concept{constructors}
