作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试创建一个空的 SpatialLines 对象。使用多边形很容易:
SpatialPolygons(list())
对于空间线这不起作用:
SpatialLines(LinesList = list())
Error in bb[1, ] : incorrect number of dimensions
SpatialLines(LinesList = Lines(list(),ID = "a"))
Error in as.list.default(X) :
no method for coercing this S4 class to a vector
SpatialLines(LinesList = Lines(slinelist = Line(coords = cbind(x = c(), y = c())), ID = c()))
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘coordinates’ for signature ‘"NULL"’
有人知道如何创建一个空的 SpatialLines 对象吗?
解决方法
我找到了一个可能不是最好的解决方法。我生成了一条没有长度的空间线:
SpatialLines(list(Lines(Line(coords = cbind(x = c(0,0), y = c(0,0))), ID = "A")))
最佳答案
有趣的问题!
我能够解决的唯一方法是创建一条虚拟线并将其删除,如下所示:
sl <- SpatialLines(LinesList = list(Lines(Line(matrix(0, ncol = 2)), ID = NA)))
sl <- sl[0]
length(sl)
# [1] 0
添加虚拟行时,长度按预期返回为 1:
length(rbind.SpatialLines(sl, SpatialLines(list(Lines(Line(coords = cbind(x = c(0,0),
y = c(0,0))),
ID = "A")))))
# [1] 1
关于r - 创建空空间线对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46724808/
根据 Android docs ,activity生命周期如下: onCreate() onStart() onResume() onPause() onStop() onDestroy() 问题是,
我有一门类(class)有很多专栏,但这个问题只需要其中三个: ---------------------------------------- | start_date | start_time
给定在同一个 Tomcat 6 上运行的两个 Web 应用程序。如果您从一个应用程序到另一个应用程序进行 http 调用,Tomcat 是否会“短路”此调用,或者它会在调用之前一直在 interweb
我是一名优秀的程序员,十分优秀!