I'm trying to make a buffer around each polygon in my data. At some point I get:
Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td, unaryUnion_if_byid_false, : TopologyException: Input geom 1 is invalid: Ring Self-intersection at or near point
I tried to repair the shapefile with
land1 <- gBuffer(land1, byid=TRUE, width=0)
but didn't work.
How can I find the polygons that are problematic?
which(!gIsValid(land1, byid=TRUE)) but didn't get the right answer.