% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ddbs_ops_unary.R
\name{ddbs_geometry_type}
\alias{ddbs_geometry_type}
\title{Get the geometry type of features}
\usage{
ddbs_geometry_type(x, by_feature = TRUE, conn = NULL)
}
\arguments{
\item{x}{Input spatial data. Can be:
\itemize{
\item A \code{duckspatial_df} object (lazy spatial data frame via dbplyr)
\item An \code{sf} object
\item A \code{tbl_lazy} from dbplyr
\item A character string naming a table/view in \code{conn}
}
Data is returned from this object.}

\item{by_feature}{Logical. If \code{TRUE}, the geometric operation is applied
separately to each geometry. If \code{FALSE}, the geometric
operation is applied to the data as a whole.}

\item{conn}{A connection object to a DuckDB database. If \code{NULL}, the function
runs on a temporary DuckDB database.}
}
\value{
A factor with geometry type(s)
}
\description{
Returns the type of each geometry (e.g., POINT, LINESTRING, POLYGON) in the
input features.
}
\examples{
\dontrun{
## load package
library(duckspatial)

## read data
countries_ddbs <- ddbs_open_dataset(
  system.file("spatial/countries.geojson", 
  package = "duckspatial")
)

# option 1: passing sf objects
# Get geometry type for each feature
ddbs_geometry_type(countries_ddbs)

# Get overall geometry type
ddbs_geometry_type(countries_ddbs, by_feature = FALSE)
}
}
