Plot almost anything using the GBIF maps api - GBIF Data Blog

The GBIF maps api is an under-used but powerful web service provided by GBIF. The maps api is used by the main GBIF portal to create the maps including the big map used on gbif.org. We can make a simple call to the api by pasting the link below into a web browser.


This is a companion discussion topic for the original entry at https://data-blog.gbif.org/post/gbif-maps-api-using-r-and-leaflet/

How can user cite the GBIF maps? Can they get a DOI?

I am not sure if a user can get a doi for a map.

The can get a DOI for the underlying occurrences by downloading them. I wish there was a better/easier way.

This is very cool, thank you for highlighting it! I did have to change the urls to http:// to get the maps to work on my system as a heads up for other folks.

I am also curious if there are legends for the density color bands and also if the raw density data is easily available without having to download the raw data and process it. Thanks!

Dan

1 Like

@danmcglinn I don’t think there is a legend that the GBIF maps api can give you. You are right that you probably have to get some records and pre-build the legend.

1 Like

One way of making a legend might be:
GBIFWtGbins<-c("#EDF8E9", “#BAE4B3”, “#74C476”, “#31A354”, “#006D2C”)

You can get the colors using a colorpicker https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp?hl=en-US

GBIFWtG<-leaflet::colorBin(GBIFWtGbins, domain=c(1,1e+6), bins=c(1,10,100,1000,10000,1e+6), na.color = “transparent”)

I got the bins by manually checking them

GBIFtiles<-c(1,11,101,1001,10001);
GBIFtilesLab<-c(“1-10”,“11-100”,“101-1000”,“1001-10000”,“10001+”)

leaflet() %>%
addLegend(position = “bottomleft”,
colors = GBIFWtG(GBIFtiles),
labels = GBIFtilesLab,
title = “No. Observations
Data from GBIF.org”,
opacity = 1)

cheers

2 Likes