我试图在两个多边形之间进行gDifference
,但是我收到了错误:
Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_not_poly, "rgeos_intersection") : TopologyException: Input geom 0 is invalid: Self-intersection at or near point.
所以我这样做了:
polygone1 <- gBuffer(polygone1, byid=TRUE, width=0)
polygone2 <- gBuffer(polygone2, byid=TRUE, width=0)
res <- gDifference(polygone1, polygone2)
但现在我又收到了另一个错误:
Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td, "rgeos_difference") :
TopologyException: EdgeRing::computePoints: found null Directed Edge
有没有办法解决这个问题?使用ArcGIS中的擦除功能执行相同的操作非常正常。