Occassionally other international atlases may fail to return download queries while they are upgrading their services. Error messages should be improved to make it clearer to users that the error is caused by a failed API call rather than with {galah} or with their query
library(galah)
library(taxize)
galah_config(atlas = "UK") # set to NBN Atlas
# get id for wild boar (Sus Scrofa)
id <- get_nbnid("Sus Scrofa", rows = 1)
#> == 1 queries ===============
#>
#> Retrieving data for taxon 'Sus Scrofa'
#> v Found: Sus Scrofa
#> == Results =================
#>
#> * Total: 1
#> * Found: 1
#> * Not Found: 0
ala_counts(taxa = id) # counts returned
#> [1] 755
occ <- ala_occurrences(taxa = id) # occurrence records not returned
#> This query will return 755 records
#> | | | 0% | |======================================================================| 100%
#> Error in parse_url(status$downloadUrl): length(url) == 1 is not TRUE
Additionally, it appears that ala_occurrences() may be supplying better error messages for some, but not all, errors of this type
# get id for fox
id <- get_nbnid("vulpes vulpes", rows = 1)
#> == 1 queries ===============
#>
#> Retrieving data for taxon 'vulpes vulpes'
#> v Found: vulpes vulpes
#> == Results =================
#>
#> * Total: 1
#> * Found: 1
#> * Not Found: 0
ala_counts(taxa = id) # counts returned
#> [1] 149388
occ <- ala_occurrences(taxa = id) # occurrence records not returned
#> This query will return 149388 records
#> | | | 0% | |======================================================================| 100%
#> There was an error reading the occurrence data; possibly no data was returned. This may be because
#> no valid column names have been provided. To check whether column names are valid, use `search_fields()`
#> Error in names(df) <- rename_columns(names(df), type = "occurrence"): names() applied to a non-vector
Occassionally other international atlases may fail to return download queries while they are upgrading their services. Error messages should be improved to make it clearer to users that the error is caused by a failed API call rather than with {galah} or with their query
Additionally, it appears that
ala_occurrences()
may be supplying better error messages for some, but not all, errors of this typeCreated on 2021-08-26 by the reprex package (v2.0.1)