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
orSpecies
, with all of the GBIF fields available usingobject.fieldname
, These return missing if not returned by a specific query. - Multiple results are returned as a Tables.jl compatible
Table
ofOccurrence
orSpecies
rows. ThisTable
can be converted to aDataFrame
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
above300
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.
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?
──────┼────────────────────────────────────────────────────────────
1 │ 55.5085 -21.0192 2020 1 14
2 │ 55.4133 -20.928 2020 1 23
3 │ 55.4133 -20.928 2020 1 16
4 │ 55.5085 -21.0192 2020 1 14
5 │ 55.4123 -21.0184 2020 1 13
6 │ 55.4133 -20.928 2020 1 28
7 │ 55.4133 -20.928 2020 1 16
⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮
1994 │ 55.4133 -20.928 2017 10 29
1995 │ 55.4123 -21.0184 2017 10 25
1996 │ 55.4123 -21.0184 2017 10 25
1997 │ 55.4123 -21.0184 2017 10 17
1998 │ 55.4123 -21.0184 2017 10 25
1999 │ 55.4123 -21.0184 2017 10 25
2000 │ 55.4123 -21.0184 2017 10 25