I want to find which polygons in a spatialpolygonsdataframe overlay each polygon in another spatialpolygonsdataframe. I have tried to use the function
over from the package
sp and it works fine... except that (from the help page):
points on a polygon boundary and points corresponding to a polygon vertex are considered to be inside the polygon
This is a problem for me because I end up including all neighbouring polygons as well as ones that effectively intersect. Is there any way to get around this? If possible, I'd rather avoid 'hacky' solutions like shrinking the polygons in one of the dataframes.
EDIT: the argument minDimension = 2 should do what I need:
minDimension: minimal dimension for an intersection to be counted; -1 takes any intersection, and does not order; 0 takes any intersection but will order according to dimensionality of the intersections (if returnList is TRUE, 1 (2) selects intersections with dimension 1, meaning lines (2, meaning areas)
Unfortunately, it does not seem to work with my data... (I am intersecting level 1 administrative areas for GADM and ethnic homelands from Geo-EPR - if everything works fine, I should only get matches from homelands in the same country as the administrative area, but I get ones in neighbouring countries as well).