28 #pragma warning(disable:4512)
45 DBO(
const std::string& configfile);
54 std::vector< std::vector<MeteoData> >& vecMeteo);
57 typedef struct ts_Meta {
58 ts_Meta() : since(), until(), param_dbo(), parname(), agg_type(), id(0), units_factor(1.), units_offset(0), interval(
IOUtils::unodata), ts_offset(
IOUtils::unodata), sequence(
IOUtils::unodata) {}
59 ts_Meta(
const std::string& i_param_str,
const Date& i_since,
const Date& i_until,
const std::string& i_agg_type,
const size_t i_id,
const unsigned int& i_interval,
const unsigned int& i_ts_offset,
const unsigned int& i_sequence)
60 : since(i_since), until(i_until), param_dbo(i_param_str), parname(), agg_type(i_agg_type), id(i_id), units_factor(1.), units_offset(0), interval(i_interval), ts_offset(i_ts_offset), sequence(i_sequence) {}
63 std::ostringstream os;
64 os <<
" " <<
id <<
" " << param_dbo <<
" [";
65 os << ((since.isUndef())?
"-∞" : since.toString(
Date::ISO)) <<
" - ";
66 os << ((until.isUndef())?
"∞" : until.toString(
Date::ISO)) <<
"] ";
67 os << agg_type <<
" - " << interval <<
" s - #" << sequence;
73 std::string param_dbo, parname, agg_type;
75 double units_factor, units_offset;
76 unsigned int interval, ts_offset, sequence;
79 typedef struct ts_Data {
81 ts_Data(
const Date& i_date,
const double& i_val) : date(i_date), val(i_val){}
87 void fillStationMeta();
88 void readData(
const Date& dateStart,
const Date& dateEnd, std::vector<MeteoData>& vecMeteo,
const size_t& stationindex);
89 std::vector<DBO::tsMeta> getTsProperties()
const;
90 std::vector<DBO::tsData> getTimeSerie(
const size_t& tsID,
const double& factor,
const double& offset)
const;
91 static void setUnitsConversion(DBO::tsMeta& ts);
92 std::string getParameter(
const std::string& param_str,
const std::string& agg_type)
const;
93 void mergeTimeSeries(
const MeteoData& md_pattern,
const size_t& param,
const std::vector<DBO::tsData>& vecData, std::vector<MeteoData>& vecMeteo)
const;
94 void initDBOConnection(
const Config& cfg);
96 std::vector<std::string> vecStationName;
97 std::vector<StationData> vecMeta;
98 std::vector< std::vector<DBO::tsMeta> > vecTsMeta;
99 std::string coordin, coordinparam;
100 std::string endpoint;
105 static const int http_timeout_dflt;
106 static const std::string endpoint_default, metadata_api, data_api;
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
This class enables the access to the DBO RESTful web service.
Definition: DBO.h:43
virtual void readStationData(const Date &date, std::vector< StationData > &vecStation)
Fill vecStation with StationData objects for a certain date of interest.
Definition: DBO.cc:188
virtual void readMeteoData(const Date &dateStart, const Date &dateEnd, std::vector< std::vector< MeteoData > > &vecMeteo)
Fill vecMeteo with a time series of objects corresponding to the interval indicated by dateStart and ...
Definition: DBO.cc:195
DBO(const std::string &configfile)
Definition: DBO.cc:125
DBO & operator=(const mio::DBO &)
Definition: DBO.cc:159
~DBO()
Definition: DBO.cc:154
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
@ ISO
ISO 8601 extended format combined date: YYYY-MM-DDTHH:mm:SS.sss (fields might be dropped,...
Definition: Date.h:91
A class representing the IO Layer of the software Alpine3D. For each type of IO (File,...
Definition: IOInterface.h:98
This is a wrapper class around picoJson and Curl.
Definition: JsonWrapper.h:75
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:108
const double nodata
This is the internal nodata value.
Definition: IOUtils.h:75
std::string toString(const T &t)
Definition: IOUtils.h:294
const unsigned int unodata
Definition: IOUtils.h:76