Web GIS for analysis of the past and future of the climate and hydrological conditions in the North-West of Russia

. This paper discusses the development of a specialized web GIS (geoportal) dedicated to the analysis of changes in climate conditions and hydrological regime in the North-West of Russia. One of the main goals of geoportal is to provide a tool to answer simple questions about climate for wide range of users. For example, how has the climate and hydrology changed in a particular city over the past 70 years? What will it be like in 50 years? The main functionality, data and creation technologies are presented. Geoportal offers the tools that allow interactive processing of daily data time series on minimum, average, maximum air temperatures, precipitation and surface runoff, represented by both reanalysis data from 1950 and predictive data up to 2100. Information about actual observations at weather stations and hydrological posts is also available. Access to the geoportal is provided through the user's web GIS interface and through the HTTP interface for developers, which opens up opportunities for integrating data into third-party services.


Introduction
In recent years, climate change, its causes and potential consequences have been the subject of unprecedented attention. Actually, now it is not only a scientific problem, but economic, political, and ideological one. This is not surprising, because climate largely determines the structure of civilization, its diversity, and the specifics of economic interaction mechanisms. Moreover, climate change will lead to the need to adapt to new conditions [1]. Adaptation and preparation for it requires the consolidation of resources, and this already leads to conflicts. Every day one can read a new article in the media either about exposing the climate conspiracy, or about the need to immediately change the structure of consumption and the economy under the threat of terrible consequences. In such circumstances, most people choose their position based on personal sympathy for public figures (in other words, the aesthetic position determines the ethical one), and the weight of the scientific community in this sense remains low. One of the reasons is the lack of direct communication between scientists and citizens. For example, people find it difficult to access scientifically based answers to the most basic, simple questions: How has the climate in my region changed in recent decades? What will happen with climate in my city (or in the city where my family lives) in 30, 50, 100 years? How to understand the probability of these forecasts, how much do scientists doubt? One of the potentially effective ways to bridge the gaps is to develop local information services aimed at providing convenient ways to access climate information for both nonspecialists and people who are professionally engaged in environmental science. The purpose of this work was to create a prototype of a geoportal that offers a set of services and data for analyzing climate and hydrological changes in the North-West of Russia.

Data
The key and primary issue related to the development of such information resources is what datasets should be provided and how to ensure their representativeness. Currently, the following data sets have been used in the development of the geoportal prototype: 1. Observations of air temperature and precipitation at 121 meteorological stations and observations of water level and water discharge at 186 hydrological posts in the North-West of Russia. Data on meteorological observations are obtained from the NOAA Global Surface Summary of Day database. Data on observations of water levels and flow rates at hydrological gauges are provided by the State hydrological institute (Saint Petersburg, Russia). 2. Continuous daily climate reanalysis data (air temperature and precipitation) for the period from 1950 to 2017, provided by the European Climate Assessment & Dataset project [2]. The spatial resolution of the reanalysis is 0.5x0.5 degrees. 3. Reanalysis of surface runoff for the period from 1979 to 2016 with spatial resolution 0.25x0.25 degrees. The reanalysis is based on data from SWAP [3] and ERA-Interim [4]. Calculations were performed using the GR4J hydrological model [5]. 4. Predictive data on changes in surface runoff volume for the period from 2017 to 2100. Calculations are presented in three variations, in accordance with three scenarios: RPC 2.6, 6.0, 8.5 [6]. 5. Boundaries of catchment areas for cities and for hydrological gauges. 6. Vector spatial data on the location of cities from the Open Street Map project.

Web GIS architecture
The web service is built on the principles of the client-server architecture using the REST concept [7], which offers a practical and universal way of interaction between the server application and clients. Server application that processes requests over the HTTP protocol is the core of the service. The tasks of this application include distributing queries across related databases, aggregating responses, and sending formalized results back to clients. Data storage is distributed between the SQL server database management system (DBMS) and the file-based storage. The file-based storage contains daily gridded data sets (large multi-dimensional matrices). The DBMS contains the rest of the information -spatial data, hydrometeorological observations and metadata (Fig. 1).
The technological stack of the geoinformation system is based on open-source software and includes: A server application that implements a programming interface (API) based on the Python programming language and the Flask framework.
A PostgreSQL database management system with the PostGIS spatial extension for storing data and metadata. ORM interfaces (based on python libraries sqlalchemy and geoalchemy) for optimal interaction of the server application with the DBMS. Nginx web server. Python analytical libraries: scipy, numpy, gdal, matplotlib. Gridded data sets are stored in the Ext4 file system in the npy binary format (a file dump of the internal storage format of the Python numpy library). Mechanism for quickly converting grid data sets to standard NetCDF and GeoTiff formats for storage and exchange is provided. The DBMS stores links to these damps, which are quickly read by the server application for further processing if necessary.

Tools
About 20 tools were implemented to the geoportal for interacting with spatial data, which help the user to extract time series data, calculate statistical characteristics and trends, generalize data on the borders of watersheds or other territories. The main tools include: The ability to visualize any time series of observations at a hydrological or meteorological post, the ability to upload this time series in CSV format (Fig. 2). The ability to calculate a spatial trend for any set of gridded data over an arbitrary period of time (Fig. 3). The ability to extract (visualize, export to CSV) a time series for any cell in any gridded dataset, including aggregation by month or year. Special tool allows to extract time series for a specific day of the year (for example, for February 1 in the all years from 1950 to 2000). Calculation of statistical indicators and graphical visualization of any daily data set with spatial (within a catchment area or arbitrary user geometry) and temporal aggregation (Fig. 4). All tools can be called either through the web GIS graphical interface or through the software interface, which allows embedding them in third-party applications if necessary.   Informational web services that offer the tools for obtaining and processing data are not a scientific breakthrough or analytical material in themselves, but they help users to get new knowledge faster and more effectively, and use it in their future work and life. In the future, developed web GIS can become one of the important regional resources that improve and simplify access to climate and hydrological data for a wide range of users.
-05-41118 "GIS mapping of runoff and its changes under nonstationary climate: case study of North-West of Russia".