produce_site_map: Provide a map object of a sites LTER.

View source: R/produce_site_map.R

produce_site_mapR Documentation

Provide a map object of a sites LTER.

Description

[Stable] This function produces a map of the site boundaries as provided by the DEIMS-SDR catalogue, within a given country and network.

Usage

produce_site_map(
  deimsid,
  countryCode,
  listOfSites,
  gridNx,
  gridNy,
  width = 0.25,
  height = 0.25,
  bboxXMin = 0,
  bboxXMax = 0,
  bboxYMin = 0,
  bboxYMax = 0,
  show_map = FALSE
)

Arguments

deimsid

A character. The DEIMS ID of network from DEIMS-SDR website. DEIMS ID information here.

countryCode

A character following the SO 3166-1 alpha-3 codes. This ISO convention consists of three-letter country codes as defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special areas of geographical interest. The map produced by this function will be limited to the country indicated in this parameter; if the network has a extraterritorial sites those will not represented.

listOfSites

A sf. List of sites of specific network. This list is needed for showing another points on the map.

gridNx

A double. A numeric vector or unit object specifying x-location of viewports about country provided by countryCode parameter.

gridNy

A double. A numeric vector or unit object specifying y-location of viewports about country provided by countryCode parameter.

width

A double. A numeric vector or unit object specifying width of viewports about country provided by countryCode parameter. Default 0.25.

height

A double. A numeric vector or unit object specifying height of viewports about country provided by countryCode parameter. Default 0.25.

bboxXMin

A double. A numeric for add some unit of a bbox provided by centroid of the site. Default 0.

bboxXMax

A double. A numeric for add some unit of a bbox provided by centroid of the site. Default 0.

bboxYMin

A double. A numeric for add some unit of a bbox provided by centroid of the site. Default 0.

bboxYMax

A double. A numeric for add some unit of a bbox provided by centroid of the site. Default 0.

show_map

A boolean. When TRUE the immage of map will be plotted. Default FALSE.

Value

The output of the function is an image of the boundary of the site, OSM as base map and all country sites map.

The function output

Lake Maggiore site map

Author(s)

Alessandro Oggioni, phD (2020) oggioni.a@irea.cnr.it

References

\insertRef

sfRReLTER

\insertRef

jsonliteRReLTER

\insertRef

tibbleRReLTER

\insertRef

rasterRReLTER

\insertRef

rgeosRReLTER

\insertRef

rosmRReLTER

\insertRef

tmapRReLTER

\insertRef

gridRReLTER

Examples

## Not run: 
# Example of Lange Bramke site
sitesNetwork <- get_network_sites(
  networkDEIMSID =
  "https://deims.org/networks/e904354a-f3a0-40ce-a9b5-61741f66c824"
)
map <- produce_site_map(
  deimsid = "https://deims.org/8e24d4f8-d6f6-4463-83e9-73cac2fd3f38",
  countryCode = "DEU",
  listOfSites = sitesNetwork,
  gridNx = 0.2,
  gridNy = 0.7
)

# Example of Eisenwurzen site
sitesNetwork <- get_network_sites(
  networkDEIMSID =
  "https://deims.org/networks/d45c2690-dbef-4dbc-a742-26ea846edf28"
)
map <- produce_site_map(
  deimsid = "https://deims.org/d0a8da18-0881-4ebe-bccf-bc4cb4e25701",
  countryCode = "AUT",
  listOfSites = sitesNetwork,
  gridNx = 0.2,
  gridNy = 0.7
)

# Example of Lake Maggiore site
sitesNetwork <- get_network_sites(
  networkDEIMSID =
  "https://deims.org/network/7fef6b73-e5cb-4cd2-b438-ed32eb1504b3"
)
# In the case of Italian sites are selected only true sites and excluded the
# macrosites.
sitesNetwork <- (sitesNetwork[!grepl('^IT', sitesNetwork$title),])
sf::st_crs(sitesNetwork) = 4326
siteMap <- produce_site_map(
  deimsid = "https://deims.org/f30007c4-8a6e-4f11-ab87-569db54638fe",
  countryCode = "ITA",
  listOfSites = sitesNetwork,
  gridNx = 0.7,
  gridNy = 0.35,
  show_map = TRUE
)
siteMap

# with show_map = FALSE
siteMap <- produce_site_map(
  deimsid = "https://deims.org/f30007c4-8a6e-4f11-ab87-569db54638fe",
  countryCode = "ITA",
  listOfSites = sitesNetwork,
  gridNx = 0.7,
  gridNy = 0.35
)
siteMap

## End(Not run)


oggioniale/ReLTER documentation built on Jan. 4, 2024, 3:48 p.m.