我有一个大的多边形数据集,并且有一个循环,我正在尝试在某个点上查找,计算和存储交叉点。在第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
的内容吗?
由于
答案 0 :(得分:2)
它从字面上向您显示调用函数的方式以及发生错误的位置。检查此示例:
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
的{{1}}调用了b
,然后在c
中发生了错误。它向您显示调用环境。