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 user is allowed to select stations with the STATIONS keyword (see below). That is why the SQL query has to end with a 'WHERE id_column_name IN' clause, for example:
SELECT id, station_name AS name, x_coord AS x, y_coord AS y, z AS altitude, epsg from all_stations WHERE id IN
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 STATIONID (this will be dynamically replaced by the plugin). To set the upper and lower bounds for the date the SQL query has to contain DATE_START and DATE_END. These keywords will be dynamically replaced by the plugin with the correct date. 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 = ''STATIONID'' AND date>=''DATE_START'' AND date<=''DATE_END'' ORDER BY date
Units are assumed to be pure SI, except:
This plugin uses the following keywords: