st_cast | R Documentation |
Cast geometry to another type: either simplify, or cast explicitly
## S3 method for class 'sftime'
st_cast(x, to, ..., warn = TRUE, do_split = TRUE)
x |
An object of class |
to |
character; target type, if missing, simplification is tried; when |
... |
ignored |
warn |
logical; if |
do_split |
logical; if |
x
with changed geometry type.
# cast from POINT to LINESTRING
g <- st_sfc(st_point(1:2), st_point(c(2, 4)))
time <- Sys.time()
x <-
st_sftime(a = 3:4, g, time = time) %>%
dplyr::group_by(time) %>%
dplyr::summarize(do_union = TRUE) %>%
st_cast(to = "LINESTRING")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.