ropensci / spocc

Species occurrence data toolkit for R
https://docs.ropensci.org/spocc
Other
116 stars 27 forks source link

Problem when geometry as a list and name passed together #146

Closed sckott closed 9 years ago

sckott commented 9 years ago

From discussion forum https://discuss.ropensci.org/t/spocc-and-bounding-boxes/233/7

Ah, there must be some interaction when you give geometry as a list and when you also give a taxon name to query. I think i've identified the line of code that's causing the problem https://github.com/ropensci/spocc/blob/master/R/occ.r#L80 - looks like when a taxon name and geometry as a character or numeric vector we're fine, but if it's a list, then it blows up.

sckott commented 9 years ago

a bit complicated. We can either let users loop over many names, many geometry inputs, but not both

So, if many names, which is the problem here, then geometry could be collapsed to a single input. BUT, see below, none of the data sources accept a wkt POLYGON with multiple polygons in it.

So, we're forced to do a new query for each bounding box/WKT string given in this scenario

wkt & bbox

bbox only

neither

sckott commented 9 years ago

issue opened in GBIF issue tracker to see if we can get support for more than 1 polygon passed in WKT string

sckott commented 9 years ago

fixed now, AFAIK