我正在尝试使用 R 包从多个区域下载多个分类群的出现数据rgbif
。我更喜欢通过将所有区域组合在一起来进行一次下载(因为我有数千个区域,单独下载会很疯狂)。但是,我没有找到这样做的方法。我可以occ_download
为每个查询做一个区域。
这是我的示例代码:
library(rgbif)
gbif_taxon_keys = c(212, 359)
# below are bbox of 3 regions;
# I have polygons as WKT, but they are clockwise
# (how to convert to counter clockwise??)
wkts = c("POLYGON((11.3431 47.2451,11.4638 47.2451,11.4638 47.2919,11.3431 47.2919,11.3431 47.2451))",
"POLYGON((12.9644 47.7608,13.0922 47.7608,13.0922 47.8453,12.9644 47.8453,12.9644 47.7608))",
"POLYGON((14.2284 48.2217,14.3669 48.2217,14.3669 48.3443,14.2284 48.3443,14.2284 48.2217))")
# this works
queries = occ_download_prep(
pred_in("taxonKey", gbif_taxon_keys),
pred("hasCoordinate", TRUE),
pred("hasGeospatialIssue", FALSE),
pred_within(wkts[1]),
user = gbif_user, pwd = gbif_pwd,
email = gbif_email)
out_test = occ_download_queue(.list = list(queries))
# now try to combine regions in one download
# this does not work
queries = occ_download_prep(
pred_in("taxonKey", gbif_taxon_keys),
pred("hasCoordinate", TRUE),
pred("hasGeospatialIssue", FALSE),
pred_within(wkts),
user = gbif_user, pwd = gbif_pwd,
email = gbif_email)
out_test = occ_download_queue(.list = list(queries))
Error: 'value' must be length 1
# this does not work neither (it runs though)
queries = occ_download_prep(
pred_in("taxonKey", gbif_taxon_keys),
pred("hasCoordinate", TRUE),
pred("hasGeospatialIssue", FALSE),
pred("geometry", paste0(wkts, collapse = ";")),
user = gbif_user, pwd = gbif_pwd,
email = gbif_email)
out_test = occ_download_queue(.list = list(queries))
<<gbif download metadata>>
Status: KILLED
从我的GBIF下载中心,它说“下载请求不成功。”。
有人能帮忙吗?谢谢!