我的理解是,"H3地理空间索引系统“是优步开发的一种”坐标系“,它的主要特点是它是基于一个等级六边形的系统。"he“是R中的一个库,它可以帮助人们处理这个"H3空间参考系统”中的数据,但它不是存储在CRAN中,而是存储在GitHub (https://github.com/crazycapivara/h3-r)中。
但是,我还没能在R中安装这个库。我已经尝试过了(正如GitHub中的说明所建议的):
install.packages("devtools")
devtools::install_github("crazycapivara/h3-r")但它不起作用,并返回以下消息:
devtools::install_github("crazycapivara/h3-r")
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘digest’然后,我在"R-cloud“中尝试了相同的步骤,得到了一个不同的错误:
h3_hex-ring.cpp:2:22: fatal error: h3/h3api.h: No such file or directory
compilation terminated.
/opt/R/4.0.3/lib/R/etc/Makeconf:181: recipe for target 'h3_hex-ring.o' failed
make: *** [h3_hex-ring.o] Error 1
ERROR: compilation failed for package ‘h3’
* removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/4.0/h3’
Error: Failed to install 'h3' from GitHub:
(converted from warning) installation of package ‘/tmp/RtmpzwLngc/file1698ded56/h3_3.3.2.tar.gz’ had non-zero exit status我检查了那个GitHub,但我不能找出问题出在哪里。有没有人已经在R上成功地安装了这个库,或者知道一个不同的库来使用这种空间参考系统?
发布于 2021-06-13 11:48:52
您直接的问题是,在安装h3-r之前,您似乎需要安装依赖包'digest‘(以及其他包)。首先尝试这样做(我假设您也能够构建底层的C包)。
我不确定h3-r是如何积极维护的,所以它在R的最新版本中可能不能很好地发挥作用。如果你想尝试通过js transpile在R中使用H3,请尝试https://github.com/obrl-soil/h3jsr (免责声明:我是作者)。它可能会很难处理非常大的数据集,但对于大多数较小的应用程序应该是可以的。
https://stackoverflow.com/questions/64627555
复制相似问题