-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
FR: Implement by_feature
to st_union()
when x and y are provided
#2259
Comments
I would suggest to do this with |
by_element
to st_union()
by_feature
to st_union()
when x and y are provided
Sounds like a good idea. Thanks for the clarification. I updated my feature request accordingly to reflect that. |
The pairwise geometries you're looking for you can now get with |
It works as you suggest, but I would have never thought to do it this way. I think this could be added to the st_union docs? Edit: The st_geometry option has the disadvantage of dropping all non-geometry columns from For ref new_line_shp <- st_union(st_geometry(my_x), st_geometry(my_y)) |>
sf::st_cast("LINESTRING") |>
sf::st_as_sf() |>
dplyr::rename(geometry = x)
# to get the geometry column at the end.
bind_cols(
my_x |> sf::st_drop_geometry(),
new_line_shp) |>
sf::st_as_sf() |
Hi,
I was wondering if it would be possible to implement a method
by_feature
argument tost_union()
when x and y a provided.My use case would be to have two sf objects as data frame. and to compute pairwise union
I have 2 shapefiles that have the same number of rows. I want to create a line for each row.
I can't figure out how to do it.
Here is my example code
Created on 2023-11-09 with reprex v2.0.2
Maybe
could work?
Similar to
sf::st_distance()
Thanks
The text was updated successfully, but these errors were encountered: