I have two shapefiles—let’s call them shp1.shp and shp2.shp—and I want to create a new shapefile of overlaps between the two.
Essentially, I'm trying to determine which geographies from shp1 fall within shp2. Most shp1 polygons will contain shp2 polygons, and some shp2 polygons will fall within multiple shp1 polygons.
If I start with
library(sp)
large_list <- over(shp1,shp2, returnList = TRUE)
that gets me a Large List of shared geographies. But how do I take that list and use it to do a spatial join, and create a new shapefile?
I'm relatively new to R (especially for GIS) and any help would be appreciated.