25#include <libxml/parser.h>
26#include <libxml/xpath.h>
52 typedef enum METEOREADSTATUS { read_ok, read_continue, read_stop } MeteoReadStatus;
54 void init(
const Config& cfg);
55 void scanMeteoPath(
const std::string& meteopath_in, std::vector< std::pair<Date,std::string> > &meteo_files)
const;
56 size_t getFileIdx(
const Date& start_date)
const;
57 void openIn_XML(
const std::string& in_meteofile);
58 void closeIn_XML() noexcept;
59 bool parseStationData(const std::
string& station_id, const xmlXPathContextPtr& xpathCtx,
StationData &sd);
60 MeteoReadStatus parseMeteoDataPoint(const
Date& dateStart, const
Date& dateEnd, const xmlNodePtr &element,
MeteoData &md) const;
62 bool parseMeteoData(const
Date& dateStart, const
Date& dateEnd, const std::
string& station_id,
63 const
StationData& sd, const xmlXPathContextPtr& xpathCtx, std::vector<
MeteoData> &vecMeteo) const;
65 std::vector< std::pair<
Date,std::
string> > cache_meteo_files;
66 std::map<std::
string, std::
string> xml_stations_id;
67 std::vector<std::
string> input_id;
68 std::
string meteo_prefix, meteo_ext;
74 xmlParserCtxtPtr in_ctxt;
75 xmlXPathContextPtr in_xpathCtx;
76 xmlCharEncoding in_encoding;
78 static const
double in_tz;
79 static const xmlChar* xml_attribute;
80 static const xmlChar* xml_namespace;
81 static const xmlChar* xml_namespace_abrev;
82 static const
char* StationData_xpath;
83 static const
char* MeteoData_xpath;
85 std::
string coordin, coordinparam;
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
Reading of FieldExtra XML meteorological data. This is the plugin for reading the XML data generated ...
Definition: CosmoXMLIO.h:39
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: CosmoXMLIO.cc:474
CosmoXMLIO(const CosmoXMLIO &)
virtual void readStationData(const Date &date, std::vector< StationData > &vecStation)
Fill vecStation with StationData objects for a certain date of interest.
Definition: CosmoXMLIO.cc:428
~CosmoXMLIO() noexcept
Definition: CosmoXMLIO.cc:209
CosmoXMLIO(const std::string &configfile)
Definition: CosmoXMLIO.cc:122
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
A class representing the IO Layer of the software Alpine3D. For each type of IO (File,...
Definition: IOInterface.h:98
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:107
A class to represent meteo stations with attributes like longitude, latitude, etc.
Definition: StationData.h:41