Returns the geometry as a MULTI* geometry. If the geometry is already a MULTI*, it is returned unchanged.

st_multi(.geom, ...)

Arguments

.geom

A geometry or a set of geometries of class sfc to be grouped. The geometries are often aggregated using a dplyr::group_by() followed by a dplyr::summarise().

...

Unused.

Value

a single MULTI* geometry.

See also

Examples

library(tibble) library(dplyr) tibble(g = c("a", "a"), point = c(st_point(12, 21), st_point(21, 12))) %>% group_by(g) %>% summarise(multi = st_multi(point))
#> # A tibble: 1 x 2 #> g multi #> <chr> <MULTIPOINT> #> 1 a ((12 21), (21 12))