Skip to content
Prev 28986 / 29559 Next

df with embedded wkt lists to sf

Furthermore, if you want to get these points into a linstring you can
combine the points by group (comment) and then cast them to a line like so
below.

This is an interesting use case! Thanks for introducing me to it.

dat_sf |>
  dplyr::group_by(comment) |>
  dplyr::summarise(geometry = sf::st_cast(
    sf::st_combine(geometry), "LINESTRING"
    ))
On Thu, Jun 9, 2022 at 4:34 PM Josiah Parry <josiah.parry at gmail.com> wrote: