rspatial / geodata

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

'sp_occurrence' now returns only one row #11

Closed AMBarbosa closed 2 years ago

AMBarbosa commented 2 years ago

This was previously working fine (except for the 'geo' argument, mentioned in this other issue), but now it's returning only one row, even if the console output says there are more:

occ_gbif <- sp_occurrence(genus = "Daboia", species = "mauritanica")
# trying URL 'https://api.gbif.org/v1/occurrence/search?scientificname=Daboia+mauritanica&limit=1&coordinatestatus=true'
# Content type 'application/json' length 3922 bytes
# ==================================================
# downloaded 3922 bytes
# 
# 105 records found
# 0-105
# 105 records downloaded

nrow(occ_gbif)
# [1] 1

str(occ_gbif)
# 'data.frame': 1 obs. of  73 variables:
#  $ acceptedScientificName       : chr "Daboia mauritanica Gray, 1849"
#  $ acceptedTaxonKey             : int 5789511
# [...]
rhijmans commented 2 years ago

Thanks so much for reporting this. It works again.

library(geodata)
#Loading required package: terra
#terra 1.5.13
occ_gbif <- sp_occurrence(genus = "Daboia", species = "mauritanica")
#Loading required namespace: jsonlite
#105 records found
#0-105
#105 records downloaded
dim(occ_gbif)
#[1] 105 113