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 the GBIF website.
ResourceFunction["GBIFImport"] has the same options as Dataset.

Examples

Basic Example (1) 

Import a plain text file (information here) from GBIF with occurrences:

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

Options (1) 

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 (5) 

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 Hawaii 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]=

Using the same data, count the number of occurrences from the Hawaii islands (a 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]=

Publisher

Jofre Espigule-Pons

Version History

  • 1.0.0 – 03 August 2020

Related Resources

License Information