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.
References
Pebesma E (2018). “Simple Features for R: Standardized Support for Spatial Vector Data.” The R Journal, 10(1), 439--446. doi: 10.32614/RJ-2018-009 .
Ooms J (2014). “The jsonlite Package: A Practical and Consistent Mapping Between JSON Data and R Objects.” arXiv:1403.2805 [stat.CO]. https://arxiv.org/abs/1403.2805.
Müller K, Wickham H (2022). tibble: Simple Data Frames. R package version 3.1.7, https://CRAN.R-project.org/package=tibble.
Hijmans RJ (2022). raster: Geographic Data Analysis and Modeling. R package version 3.5-15, https://CRAN.R-project.org/package=raster.
Bivand R, Rundel C (2021). rgeos: Interface to Geometry Engine - Open Source ('GEOS'). R package version 0.5-9, https://CRAN.R-project.org/package=rgeos.
Dunnington D (2019). rosm: Plot Raster Map Tiles from Open Street Map and Other Sources. R package version 0.2.5, https://CRAN.R-project.org/package=rosm.
Tennekes M (2018). “tmap: Thematic Maps in R.” Journal of Statistical Software, 84(6), 1--39. doi: 10.18637/jss.v084.i06 .
R Core Team (2021). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/.
Author
Alessandro Oggioni, phD (2020) oggioni.a@irea.cnr.it
Examples
if (FALSE) {
# 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
}