ErmStationDataImporter¶
Imports the time series measured at the meteo stations and at the stream gauges. The CSV files have one column per station, identified by the station ids of the point layers, in the time series format of the HortonMachine:
@T,table
Created,2026-07-17 10:00
Author,HortonMachine library
@H,timestamp,value_1,value_2,value_3
ID,,1,2,3
Type,Date,double,double,double
Format,yyyy-MM-dd HH:mm,
,2002-01-01 01:00,1.65,0.35,3.05
,2002-01-02 01:00,-2.6,-2.65,-0.3
The ID row holds the station ids, the following rows the timestamp and the value of each station; missing values are -9999.
Parameters¶
Second step of the ERM/GeoFrame water budget workflow: imports the measurements of the meteo stations (temperature and precipitation) and of the stream gauges (discharge) into the GeoFrame database. The data files are CSV time series in the HortonMachine format, with one column per station.
Toolbox folder: GeoFrame
Status: Certified
Keywords: ERM, GeoFrame, meteo, stations, discharge, import
Authors: Daniele Andreis
Class: org.hortonmachine.hmachine.geoframe.ermworkflow.ErmStationDataImporter
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
GeoPackage file |
The GeoFrame database created by the data preparation. |
||
|
String |
Start of the period to import. Format: yyyy-MM-dd HH:mm, in UTC. |
||
|
String |
End of the period to import. Format: yyyy-MM-dd HH:mm, in UTC. |
||
|
String |
|
Time resolution of the data: HOURLY or DAILY. Allowed values: |
|
|
vector file |
The meteo stations (point vector layer). |
||
|
String |
|
Field of the meteo stations layer holding the station id, matching the ids of the CSV columns. |
|
|
CSV file |
CSV time series of the air temperatures of the meteo stations [°C]. |
||
|
CSV file |
CSV time series of the precipitations of the meteo stations [mm]. |
||
|
vector file |
The stream gauges (point vector layer). |
||
|
String |
|
Field of the stream gauges layer holding the station id, matching the ids of the CSV columns. |
|
|
CSV file |
CSV time series of the discharges of the stream gauges [m³/s]. |
Example¶
import org.hortonmachine.hmachine.geoframe.ermworkflow.ErmStationDataImporter
// the folder containing the input data: change it to yours
var workspace = "/data/COURSE_WATER/"
var ei = new ErmStationDataImporter()
ei.inGpkg = workspace + "outputs/geoframe_data.gpkg"
// time span and temporal resolution
ei.pStartTimestamp = "2006-01-01 01:00"
ei.pEndTimestamp = "2023-12-31 01:00"
ei.pTimeResolution = "DAILY"
// meteo data
ei.inMeteoStations = workspace + "meteo/meteo_stations.gpkg"
ei.pMeteoIdField = "stationid"
ei.inTemperaturesCsv = workspace + "meteo/temperatures.csv"
ei.inPrecipitationCsv = workspace + "meteo/precipitations.csv"
// discharge data
ei.inStreamGauges = workspace + "discharge/dams.shp"
ei.pStreamGaugesIdField = "stationid"
ei.inStreamGaugesCsv = workspace + "discharge/dam_data.csv"
ei.process()
The imported data can be checked in the Database Viewer: right-click on the station_data table of the GeoFrame database and choose Open Station Data Chart, then pick the station in the combo box at the top.
The data of a meteo station: the measured precipitation and temperature.¶