I need to run an error-check in R on polygons imported from shape files via sf::st_read. Polygons that share some boundary points are fine, but I need to throw an error if there are polygons that share interior points.
st_intersects tells me that polygons with common boundary points do intersect but I need to know only whether interiors intersect. Is there a fast, simple way to do this?
A simple example: Why would the following polygons' interiors overlap?
A1 <- st_polygon(list(rbind(
c(-9724223, 4954258),
c(-9724234, 4954063),
c(-9724202, 4954049),
c(-9724186, 4954169),
c(-9724211, 4954252),
c(-9724223, 4954258))))
tmp <- st_polygon(list(rbind(
c(-9724224, 4954255),
c(-9724268, 4954013),
c(-9724146, 4954008),
c(-9724148, 4954135),
c(-9724208, 4954257),
c(-9724224, 4954255))))
A2 <- st_difference(tmp, A1)
st_intersects(A2, A1)
st_overlaps(A2, A1)
st_relate(A2, A1)