New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improved st_intersection(polygons) suggestion #2242
Labels
reprex
needs a minimal reproducible example
Comments
Thanks; I guess you need this because |
My solution seems to work without setting precision. df <- structure(list(lat = c(53.218461547511, 53.2354543814792, 53.2219368310548,
53.2142084420887, 53.2051969857393), lon = c(6.57022923569802,
6.55005158685787, 6.57015231400986, 6.5633788874466, 6.5692156138519
)), row.names = c(NA, -5L), class = c("tbl_df", "tbl", "data.frame"
))
circle_df <- df %>%
st_as_sf(coords = c("lon", "lat"), crs = 4326) %>%
st_transform(3035) %>%
st_buffer(dist = units::set_units(50, "kilometers"))
# Applying st_intersection() gives an error:
circle_df %>%
st_intersection()
# But the new function does not
c_stack <- st_stack(circle_df)
mapview(c_stack)
|
Another possible solution. If of interest I can submit a pr:
From the previous example, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This function seems to work with my data, returning the n-ary intersections of my polygons. Feel free to adapt it.
The text was updated successfully, but these errors were encountered: