Integrating PostgreSQL and R: Open-source tools for processing and reporting monitoring data - Kruszyk, Robert; Dmowska, Anna; Majewski, Mikołaj; Szpikowski, Józef (Quaestiones Geographicae, 2025)
Environmental monitoring requires effective data collection, management and presentation. With the increasing amount of monitoring data, it is becoming increasingly important to develop tools for effective data management and visualisation. This paper explores the potential of integrating the PostgreSQL database system with the R environment to automate the processing, analysis and reporting of multidimensional environmental data. The results of hydrological monitoring conducted as part of the Integrated Monitoring of the Natural Environment (ZMŚP) programme were used as a case study. The basic component of the ZMŚP programme’s IT system is a relational database, where the results of environmental monitoring are stored. This database serves as a data source for the data warehouse. The data processing process, which includes archiving, verification and aggregation, uses Structured Query Language (SQL) and the procedural language PL/pgSQL. In order to generate interactive visualisations and automate reporting, the R programming environment was used in conjunction with the R Markdown tool and the plotly library. The combination of the PostgreSQL system with the plotly package in the R environment offers a number of benefits in terms of data visualisation and analysis, while also serving as an example of the use of Online Analytical Processing (OLAP) tools in the analysis and presentation of environmental data. The use of open-source solutions not only significantly reduces implementation costs but also increases the availability of technology to a wide range of users, including public institutions involved in environmental monitoring.