Wolfram Research

Function Repository Resource:

GBIFImport

Source Notebook

Import occurrences from Global Biodiversity Information Facility (GBIF) data

Contributed by: Jofre Espigule-Pons

ResourceFunction["GBIFImport"][fname]

imports the plain text file fname into a dataset using semantics for GBIF data specifications.

Details and Options

The fname is assumed to be a plain text file with occurrences downloaded from https://www.gbif.org.
ResourceFunction["GBIFImport"] has the same options as Dataset.

Examples

Basic Example

Import a plain text file from GBIF with occurrences (data citation: GBIF.org (22 July 2020) GBIF Occurrence Download https://doi.org/10.15468/dl.3jcfby):

In[1]:=
ResourceFunction[
 "GBIFImport"]["https://www.wolframcloud.com/obj/jofree/GBIF/\
occurrence.txt"]
Out[1]=

Options

Options from Dataset can be directly specified in GBIFImport:

In[2]:=
ResourceFunction[
 "GBIFImport"]["https://www.wolframcloud.com/obj/jofree/GBIF/\
occurrence.txt", Background -> LightGreen]
Out[2]=

Neat Examples

Import sightings of Jackson's chameleon (Trioceros jacksonii) around the globe:

In[3]:=
triocerosData = ResourceFunction["GBIFImport"][
   "https://www.wolframcloud.com/obj/jofree/GBIF/occurrence.txt"];

Define some plotting utilities:

In[4]:=
positionsSpecies[species_String] := DeleteMissing@
  Normal@triocerosData[Select[#["Species"] == species &], "GeoPosition"]

Obtain an image of a Jackson's three-horned chameleon using WikidataSearch and WikidataData:

In[5]:=
WikidataSearch["Trioceros"]
Out[5]=
In[6]:=
triocerosImg = Import[First[
    WikidataData[
     ExternalIdentifier["WikidataID", "Q1758255", <|"Label" -> "Trioceros", "Description" -> "genus of reptiles"|>], "Image"]]];

Create a geographic distribution map of the invasive chameleon species in the Hawaiian islands:

In[7]:=
Labeled[GeoGraphics[{{Red, PointSize[0.007], Opacity[0.9], Point@positionsSpecies["Trioceros jacksonii"]}, Inset[Column[{Style["Trioceros jacksonii", FontFamily -> "Helvetica", Italic, FontSize -> 18], triocerosImg}, Center], Scaled[{.2, .25}]]},
  GeoRange -> Entity["AdministrativeDivision", {"Hawaii", "UnitedStates"}],
  ImageSize -> Large,
  GeoBackground -> GeoStyling["ReliefMap", Opacity[0.8]]], Style["Distribution of Invasive Chameleon in Hawaii", FontFamily -> "Helvetica", FontSize -> 26]
 , Top]
Out[7]=

Count the number of occurrences from the Hawaiian islands (non-native region for Trioceros jacksonii species) using GeoWithinQ:

In[8]:=
Counts@GeoWithinQ[
  Entity["AdministrativeDivision", {"Hawaii", "UnitedStates"}], DeleteMissing@
   Normal@triocerosData[
     Select[#["Species"] == "Trioceros jacksonii" &], "GeoPosition"]]
Out[8]=

Resource History

Related Resources

License Information