I would like to get the greens polygons that intersects (or overlapsed) the red outlined polygon (see image below).
I tried sf::st_intersection()
but the polygon in yellow (yes that just one polygon) was not taken in account.
In QGIS, the clip (cut) tool did exactly what I wanted. Is there a tool similar in R to cut a layer using another layer ?
Tried to use sf::st_overlaps()
but the returned matrix was biggest than my feature table. sf::st_crops()
does not fit either as I want to cut in a specific shape.
sf::st_intersects()
miss the yellow polygon (and so does QGIS geoprocessing tool). I'm not a native english speaker so I might have misused the word "fit". Actually, I started by an intersection by habit, and because I didn't thought there will be big polygons like this one, but cutting is more what I need for this use case. So my question is still valid.sf::st_intersection()
is not working: geocompr.robinlovelace.net/figures/venn-clip-1.png Do you need to clip the green subsection within the red outline, or both the yellow and the green together? Would performing ast_union()
before clipping work for you?