1

我正在尝试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 中使用 Erase 功能做同样的事情效果很好。

4

0 回答 0