2017-06-19 135 views
0

我一直试图在各点之间生成LCP网络。我的一些数据集已经取得了一些成功,但是其他集会导致我尝试运行该函数时发生错误。数据都遵循相同的格式并驻留在相同的CRS中,所以我不明白问题所在。我已经尝试了一些解决方法,但目前为止没有采取任何措施。我已经包含了我使用的基本脚本。LCP生成错误

library(rgdal) 
library(gdistance) 
TRI<-raster("pathway.tif") 
points<-readOGR("pathway.shp") 
cost<-transition(TRI,sum,8) 
LCP<-shortestPath(cost,points[1,],points[-1,],output="SpatialLines") 

这些争论已经工作了我的数据集的某些部分,但其中几人后,我输入上面的最后一行显示以下错误消息,我不知道该修复程序是什么,因为我是很新到R:

Error in validObject(.Object) : 
invalid class “SpatialLines” object: bbox should never contain infinite values 
In addition: Warning messages: 
1: In .Call("R_igraph_get_shortest_paths", graph, as.igraph.vs(graph, : 
At structural_properties.c:4517 :Couldn't reach some vertices 
2: In min(x) : no non-missing arguments to min; returning Inf 
3: In max(x) : no non-missing arguments to max; returning -Inf 
4: In min(x) : no non-missing arguments to min; returning Inf 
5: In max(x) : no non-missing arguments to max; returning -Inf 

任何帮助或建议,非常感谢。谢谢!

回答