ropensci / rgbif

Interface to the Global Biodiversity Information Facility API
https://docs.ropensci.org/rgbif
Other
152 stars 51 forks source link

Add geospatial issues to output for occurrence endpoints #102

Closed sckott closed 9 years ago

sckott commented 9 years ago

from @timrobertson100

...we were wondering if you could please add the geospatial issues to the response in R. E.g. you can see it on: http://api.gbif.org/v1/occurrence/1234567 This is one of the most important fields for people to determine if there are known issues with the records.

sckott commented 9 years ago

You can get geospatial issues field by specifying fields=all, e.g., getting a single occurrence /occurrence/{key}

occ_get(key=766766824, return='data', fields = "all")
             name       key                           datasetKey                     publishingOrgKey publishingCountry    protocol
1 Corvus monedula 766766824 38b4c89f-584c-41bb-bd8f-cd1def33e92f b8323864-602a-4a7d-9127-bb903054e97d                SE DWC_ARCHIVE
                   lastCrawled                   lastParsed extensions     basisOfRecord taxonKey kingdomKey phylumKey classKey orderKey familyKey
1 2014-08-22T17:46:58.881+0000 2014-05-29T16:25:37.014+0000       none HUMAN_OBSERVATION  2482473          1        44      212      729      5235
  genusKey speciesKey                 scientificName  kingdom   phylum         order   family  genus         species genericName specificEpithet
1  2482468    2482473 Corvus monedula Linnaeus, 1758 Animalia Chordata Passeriformes Corvidae Corvus Corvus monedula      Corvus        monedula
  taxonRank decimalLongitude decimalLatitude coordinateAccuracy elevation elevationAccuracy depth depthAccuracy stateProvince year month day
1   SPECIES          17.9054         59.4568                  1        -1                 0     1             0    Stockholms 2013     1   2
                     eventDate                                      issues                     modified              lastInterpreted identifiers
1 2013-01-01T23:00:00.000+0000 GEODETIC_DATUM_ASSUMED_WGS84,DEPTH_UNLIKELY 2013-07-05T00:01:12.000+0000 2014-06-05T14:22:20.153+0000        none
  facts relations geodeticDatum class countryCode country    gbifID institutionCode  county catalogNumber            locality
1  none      none         WGS84  Aves          SE  Sweden 766766824   ArtDatabanken Uppland Bird.27600324 Matningen N Ravalen
                                      identifier collectionCode                identifiedBy
1 urn:lsid:artportalen.se:Sighting:Bird.27600324        Artport Göran Frisk, Kristina Frisk

and geospatial issues using the search occurrence endpoint /occurrence/search

gg <- occ_search(taxonKey=3119195, limit=2, fields = "all")
gg$data$issues
[1] "COORDINATE_ROUNDED,GEODETIC_DATUM_ASSUMED_WGS84"                                 
[2] "COORDINATE_ROUNDED,GEODETIC_DATUM_ASSUMED_WGS84,COUNTRY_DERIVED_FROM_COORDINATES"

Issues aren't given back by default. Do you think they should? I decided to give back just a minimal set of fields, but perhaps I should give back more fields or all of them by default?

sckott commented 9 years ago

I'll add issues field to the default output - thinking that may need to create abbreviations for each issue class since they are so long

sckott commented 9 years ago

this is done now