A flexible wrapper for sf::st_geometry_type and sf::st_is.
Usage
is_geom_type(x, type = NULL, by_geometry = FALSE, ext = TRUE)
is_point(x, by_geometry = FALSE)
is_multipoint(x, by_geometry = FALSE)
is_line(x, by_geometry = FALSE)
is_multiline(x, by_geometry = FALSE)
is_polygon(x, by_geometry = FALSE)
is_multipolygon(x, by_geometry = FALSE)
Arguments
- x
A
sf
orsfc
object passed to sf::st_geometry_type- type
If "POINT", check if geometry type is POINT. Same for all available geometry types; not case sensitive; Default:
NULL
- by_geometry
Passed to sf::st_geometry_type; defaults to
FALSE
- ext
For st_geom_type, if ext
TRUE
and check isNULL
, return a list with checks for POINTS, POLYGONS, LINESTRING, and the returned types.
Value
If ext is FALSE and type is NULL, returns vector with geometry types
identical to sf::st_geometry_type. If ext is TRUE
, returns a list and,
if type is not NULL
, returns a logical vector.