AtlasOfLivingAustralia / ALA4R

Access data and resources hosted by the Atlas of Living Australia (ALA)
https://atlasoflivingaustralia.github.io/ALA4R/
42 stars 8 forks source link

specieslist() returns error when fq is only parameter specified #25

Closed snubian closed 7 years ago

snubian commented 7 years ago

E.g.:

> x <- ALA4R::specieslist(fq = c("kingdom:Plantae", "state:New South Wales"))
Error in ALA4R::specieslist(fq = c("kingdom:Plantae", "state:New South Wales")) : 
  invalid request: need either fq or wkt parameter to be specified

It works fine if I add a wkt parameter.

raymondben commented 7 years ago

Hmm, couple of things going on with this one. First, the error message is misleading (i.e. wrong). It should say "need either taxon or wkt parameter to be specified" not "need either fq or wkt parameter to be specified". Easy fix. But something else has changed with the way the ALA servers deliver this service. The taxon parameter doesn't work at all (I think this is an error at the server end), and furthermore an fq query on its own does now work (previously it didn't; I assume this is an undocumented change in behaviour). Shall investigate further ... (Edited: it's an fq query, not a wkt query that now works on its own whereas it previously didn't)

snubian commented 7 years ago

Thank you for such a quick reply, much appreciated.

In case it's relevant, the taxon parameter is working OK for me now:

> x <- ALA4R::specieslist(taxon = "Gingidia", fq = "state:New South Wales")
> x$speciesName
[1] "Gingidia algens"    "Gingidia harveyana" "Gingidia montana"   "Gingidia rupicola"  "Gingidia"   
raymondben commented 7 years ago

OK, this one should be resolved in the current github version (install with devtools::github_install("AtlasOfLivingAustralia/ALA4R") )

> x <- ALA4R::specieslist(fq = c("kingdom:Plantae", "state:New South Wales"))
> dim(x)
[1] 16552    12

I don't think taxon searching works reliably, but this is a back-end server bug that should be resolved on the next indexing run (see https://github.com/AtlasOfLivingAustralia/ALA4R/issues/24#issuecomment-290237018).