Skip to content

Latest commit

 

History

History
69 lines (56 loc) · 3.33 KB

README.md

File metadata and controls

69 lines (56 loc) · 3.33 KB

GBIF2

Stable Dev Build Status Coverage

The goals of GBIF2 is to follow the GBIF api as completely and correctly as possible.

Its main design features are:

  • Single results are returned with type Occurrence or Species, with all of the GBIF fields available using object.fieldname, These return missing if not returned by a specific query.
  • Multiple results are returned as a Tables.jl compatible Table of Occurrence or Species rows. This Table can be converted to a DataFrame or writted directly to disk using CSV.jl and similar packages.
  • All GBIF enum keys are checked for correctness before querying so that only correct queries can be sent. Clear messages point to errors in queries.
  • A limit above 300 items at a time is allowed, unlike in the original API, by making multiple reuests and joining the results.
  • For even larger queries, download requests are handled with gbif.org account authentication.

A quick example

julia> using GBIF2, DataFrames

# Basic species match with `species_match`:
julia> sp = species_match("Lalage newtoni");

julia> sp.species
"Coracina newtoni"

julia> sp.synonym
true

julia> sp.vernacularName
missing

# Get a more detailed object with `species`:
julia> sp_detailed = species(sp);

julia> sp_detailed.vernacularName
"Reunion Cuckooshrike"

# Get the first 2000 occurrences for the species from 2000 to 2020, on reunion:
julia> oc = occurrence_search(sp;
           limit=2000, country=:RE, hasCoordinate=true, year=(2000,2020)
       ) |> DataFrame
2000×83 DataFrame
  Row │ decimalLongitude  decimalLatitude  year    month   day
      │ Float64?          Float64?         Int64?  Int64?  Int64?
──────┼────────────────────────────────────────────────────────────
    155.5085         -21.0192    2020       1      14
    255.4133         -20.928     2020       1      23
    355.4133         -20.928     2020       1      16
    455.5085         -21.0192    2020       1      14
    555.4123         -21.0184    2020       1      13
    655.4133         -20.928     2020       1      28
    755.4133         -20.928     2020       1      16
                                            
 199455.4133         -20.928     2017      10      29
 199555.4123         -21.0184    2017      10      25
 199655.4123         -21.0184    2017      10      25
 199755.4123         -21.0184    2017      10      17
 199855.4123         -21.0184    2017      10      25
 199955.4123         -21.0184    2017      10      25
 200055.4123         -21.0184    2017      10      25