R:拓扑异常错误

时间:2015-08-23 19:58:07

标签: r geospatial sp

我试图在两个多边形之间进行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中的擦除功能执行相同的操作非常正常。

0 个答案:

没有答案