rspatial / geodata

download geographic data
GNU General Public License v3.0
150 stars 15 forks source link

'sp_occurrence' with 'geo=TRUE' still returns NA coordinates #9

Closed AMBarbosa closed 2 years ago

AMBarbosa commented 2 years ago

The 'geo' argument says "only records that have a georeference (longitude and latitude values) will be downloaded", but this doesn't seem to be the case:

gf <- sp_occurrence(genus = "Daboia", species = "mauritanica", geo = F)
gt <- sp_occurrence(genus = "Daboia", species = "mauritanica", geo = T)
all.equal(gf, gt)  # TRUE
gt[ , c("lon", "lat")]  # NA coordinates still there

Cheers!

rhijmans commented 2 years ago

Thanks very much again, again. There was a change in the GBIF API that I had not noticed. I now get:

library(geodata)
gt <- sp_occurrence(genus = "Daboia", species = "mauritanica", geo = T)
#Loading required namespace: jsonlite
#36 records found
#0-36
#36 records downloaded