|
MeteoIODoc 20260620.13b5b0a5
Environmental timeseries pre-processing
|
This plugin connects to a generic PostgreSQL server to retrieve its meteorological data. The server parameters must be provided as well as the queries to retrieve the stations' data and metadata. In order to compile this plugin, the development package of libpq is required (this is the PostgreSQL c client library) and most probably also postgresql-server-dev-all.
This query is used to retrieve the stations' metadata. This SQL query string should retrieve the following columns as result set (in this very order):
id (int), name (string), x (easting as double), y (northing as double), altitude (height above sea level as double), epsg (int)
The plugin uses parameterized queries (PQexecParams) with $1 as the parameter placeholder for the station ID to prevent SQL injection. An example for a correct SQL metadata query string is therefore:
SELECT id, station_name AS name, x_coord AS x, y_coord AS y, z AS altitude, epsg from all_stations WHERE id = $1
This query is used to retrieve the data for the user selected stations within a given time interval. The SQL query may retrieve the following columns as result set (any order, only date is mandatory):
date (mandatory, as date), ta (double), rh (double), p (double), vw (double), dw (double), iprec (the PSUM value, double), iswr (double)
The SQL query must retrieve the data for one station only, which has to be specified as $1 (parameter placeholder). To set the upper and lower bounds for the date the SQL query must contain $2 and $3 as parameter placeholders (dates in ISO format, e.g. 2024-01-01 12:00:00). Furthermore the resultset should be ordered by date ascending. An example for a correct SQL data query string is therefore:
SELECT * FROM all_measurements WHERE id = $1 AND date >= $2 AND date <= $3 ORDER BY date
Units are assumed to be pure SI, except:
This plugin uses the following keywords: