This project is no longer maintained and will not receive any further updates. If you plan to continue using it, please be aware that future security issues will not be addressed.
Easing the access to environmental time series data from an OGC Sensor Observation Service
sos4R is an extension package of the R environment for statistical computing and visualization. sos4R is available on CRAN. The user can use it to query data from standardized SOS instances (with specific consideration of the OGC SOS 2.0 Hydrology Profile) using simple R function calls. It provides a convenience layer for R users to integrate observation data from SOS servers compliant with the SOS standard without any knowledge about the underlying OGC Sensor Web Enablement standards.
Key Technologies
- R Programming Language
- OGC Sensor Observation Service 2.0
- OGC WaterML 2.0
- OGC Observations and Measurements 2.0
Benefits
- Easier access to environmental time series data
- Automatic generation of SOS requests
- Result handling and parsing into standard R objects
- Convenience API: Data Science oriented functions to load data
install.packages("sos4R")
library("sos4R")
# connect to SOS and request metadata
mySos <- SOS(url = "http://sensorweb.demo.52north.org/sensorwebtestbed/sos",
binding = "KVP", useDCPs = FALSE, version = "2.0.0")
# retrieve available phenomena and sites
phenomena <- phenomena(sos = mySos, includeSiteId = TRUE, includeTemporalBBox = TRUE)
phenomena
siteList(sos = mySos)
# retrieve data
getData(sos = mySos,
phenomena = phenomena[5,1],
sites = phenomena[5,2],
begin = as.POSIXct("2018-01-01"),
end = as.POSIXct("2018-01-3"))
Install the development version
You can install the current development version (= the next release for CRAN) directly from GitHub:
#install.packages("remotes")
remotes::install_github("52North/sos4R", ref = "dev")
The project website is at https://52north.github.io/sos4R. You can also join the chat at on Gitter if you have any questions.
sos4R can used to download observation data or build user interfaces for requesting and rendering time series observations. The screenshot below shows a demo Shiny application, which you can run locally with
shiny::runApp(appDir = file.path(path.package("sos4R"), "shiny"))
The latest changes, updates, bug fixes can be found in the package changelog at https://52north.github.io/sos4R/news/.
sos4R is used in the following projects.
- MuDak-WRM, https://www.mudak-wrm.kit.edu/
- NIWA, https://niwa.co.nz/ (NIWA presented the project results at a dedicated workshop at the FOSS4G SOTM Oceania 2019)
See file DEV-README.md
for developer documentation or read the
developer documentation online at
https://52north.github.io/sos4R/DEV-README.html.
This R extension package is licensed under GPL v2.0.
Documentation (e.g. vignette) is published under CC BY 4.0.
sos4R is a project of 52°North Initiative for Geospatial Open Source Software.