This post has been super helpful for my work. Thanks! I have a related question. I would like to query GBIF while constraining the search spatially using TDWG level 4 regions.
I have made a list of WKT polygons. I ran a loop for each polygon with my search terms.
I’m running into a problem: when one polygon has no data, the queue stops running completely.
Error in FUN(X[[i]], …) : !is.null(key) is not TRUE
Is there a way to “skip” over polygons with no data and continue on with the query? My code:
queries ← list()
for (i in seq_along(polys)) {
queries[[i]] ←
occ_download_prep(
pred(“taxonKey”, 7707728),
pred_in(“basisOfRecord”, c(“PRESERVED_SPECIMEN”,“HUMAN_OBSERVATION”,“OBSERVATION”,“MACHINE_OBSERVATION”)),
pred(“geometry”, polys[[i]]),
pred(“hasCoordinate”, TRUE),
pred(“hasGeospatialIssue”, FALSE),
pred_gte(“year”, 1900),
format = “SIMPLE_CSV”,
user = user,
pwd = pwd,
email = email
)
}
First time posting so apologies for any errors.