我有一个很大的多边形数据集,有一个循环,我试图在某个点找到、计算和存储交叉点。在第870次迭代中,循环停止,我得到错误:
Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td, unaryUnion_if_byid_false, :
TopologyException: Input geom 0 is invalid: Ring Self-intersection at or near point 26.437120350000001 39.241770119999998 at 26.437120350000001 39.241770119999998我使用traceback(),但实际上无法理解它:
4: .Call("rgeos_intersection", .RGEOS_HANDLE, spgeom1, spgeom2,
byid, ids, PACKAGE = "rgeos")
3: RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td, unaryUnion_if_byid_false,
"rgeos_intersection")
2: gIntersection(combinations[[i]][[1, m]], combinations[[i]][[2,
m]]) at #17 . Can anyone explain what to look in ` traceback`?有人能解释一下在traceback看什么吗?
谢谢
发布于 2017-11-21 13:26:10
它从字面上显示了函数的调用方式和错误发生的位置。请检查此示例:
a <- function(x) {
b <- function(y) {
c <- function(z) {
stop('there was a problem')
}
c()
}
b()
}当我打电话给a()
> a()
Error in c() : there was a problem
4. stop("there was a problem")
3. c()
2. b()
1. a() 在上面的示例中,您可以看到a调用了b,它调用了c,然后在c中发生了错误。它向您展示了调用环境。
https://stackoverflow.com/questions/47414119
复制相似问题