Returns the type of each geometry (e.g., POINT, LINESTRING, POLYGON) in the input features.
Arguments
- x
Input spatial data. Can be:
A
duckspatial_dfobject (lazy spatial data frame via dbplyr)An
sfobjectA
tbl_lazyfrom dbplyrA character string naming a table/view in
conn
Data is returned from this object.
- by_feature
Logical. If
TRUE, the geometric operation is applied separately to each geometry. IfFALSE, the geometric operation is applied to the data as a whole.- conn
A connection object to a DuckDB database. If
NULL, the function runs on a temporary DuckDB database.
Examples
if (FALSE) { # \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)
} # }
