
Retrieve species occurrences within an eLTER site boundary
Source:R/get_site_speciesOccurrences.R
get_site_speciesOccurrences.Rd
This function downloads species occurrence records from
GBIF https://www.gbif.org,
iNaturalist https://www.inaturalist.org/ and
OBIS https://obis.org/ and intersects them with the boundary of
an eLTER site retrieved from the DEIMS-SDR API
https://deims.org/. Only occurrences falling within the site
polygon are returned, enriched with eLTER site metadata.
Usage
get_site_speciesOccurrences(
deimsid,
list_DS,
show_map = TRUE,
limit = 500,
exclude_inat_from_gbif = TRUE
)Arguments
- deimsid
A
character. The DEIMS ID of the site from DEIMS-SDR website. DEIMS ID information here.- list_DS
A
charactervector. Data sources to query; any combination of"gbif","inat", and/or"obis".- show_map
A
boolean. IfTRUEtheleafletmap is both printed and returned in the output list as$map. IfFALSEthe map is not printed but is still built and returned in$mapfor later use. DefaultFALSE.- limit
A
numeric. Maximum number of records to download per source. Default500. Note that when querying for many species the total number of records can be large and slow to download; start with a small value (e.g.10) to verify results before increasing.- exclude_inat_from_gbif
A
boolean. IfTRUE, and both"gbif"and"inat"are inlist_DS, records originating from iNaturalist are removed from the GBIF results to avoid duplicates. DefaultTRUE.
Value
A list with one sf element per data source (named gbif,
inat, obis) containing only occurrences that fall within the site
boundary, and a map element with a leaflet object. Each sf
element contains the occurrence geometry and the following eLTER site
metadata fields (prefixed with eLTER_): title, uri, created,
changed, geoCoord, country, geoElev.avg, geoElev.min,
geoElev.max, biogeographicalRegion, biome, ecosystemType,
eunisHabitat, landforms, geoBonBiome.
If no occurrences are found within the boundary for a given source,
that source is omitted from the list and an informative message is
printed. Returns invisible(NULL) if the site has no boundary or if
no occurrences are found for any source.
Author
Alessandro Oggioni, PhD (2020) oggioni.a@irea.cnr.it
Paolo Tagliolato, PhD (2020) tagliolato.p@irea.cnr.it
Martina Zilioli zilioli.m@irea.cnr.it
Examples
if (FALSE) { # \dontrun{
# Terrestrial site: Saldur River Catchment (GBIF and iNaturalist)
occ_SRC <- get_site_speciesOccurrences(
deimsid = "https://deims.org/97ff6180-e5d1-45f2-a559-8a7872eb26b1",
list_DS = c("gbif", "inat"),
show_map = TRUE,
limit = 50
)
occ_SRC
# Marine site: Gulf of Venice (OBIS only)
occ_GoV <- get_site_speciesOccurrences(
deimsid = "https://deims.org/758087d7-231f-4f07-bd7e-6922e0c283fd",
list_DS = "obis",
show_map = FALSE,
limit = 10
)
occ_GoV
# Marine site: Gulf of Venice (all sources, with map)
occ_GoV_all <- get_site_speciesOccurrences(
deimsid = "https://deims.org/758087d7-231f-4f07-bd7e-6922e0c283fd",
list_DS = c("gbif", "inat", "obis"),
show_map = TRUE,
limit = 10
)
occ_GoV_all$obis
occ_GoV_all$map
} # }
