24 #include <libxml/parser.h>
25 #include <libxml/xpath.h>
48 virtual void readMeteoData(
const Date& dateStart,
const Date& dateEnd, std::vector< std::vector<MeteoData> >& vecMeteo);
51 typedef enum METEOREADSTATUS { read_ok, read_continue, read_stop } MeteoReadStatus;
53 void init(
const Config& cfg);
54 void scanMeteoPath(
const std::string& meteopath_in, std::vector< std::pair<Date,std::string> > &meteo_files)
const;
55 size_t getFileIdx(
const Date& start_date)
const;
56 void openIn_XML(
const std::string& in_meteofile);
57 void closeIn_XML()
throw();
58 bool parseStationData(
const std::string& station_id,
const xmlXPathContextPtr& xpathCtx,
StationData &sd);
59 MeteoReadStatus parseMeteoDataPoint(
const Date& dateStart,
const Date& dateEnd,
const xmlNodePtr &element,
MeteoData &md)
const;
61 bool parseMeteoData(
const Date& dateStart,
const Date& dateEnd,
const std::string& station_id,
62 const StationData& sd,
const xmlXPathContextPtr& xpathCtx, std::vector<MeteoData> &vecMeteo)
const;
64 std::vector< std::pair<Date,std::string> > cache_meteo_files;
65 std::map<std::string, std::string> xml_stations_id;
66 std::vector<std::string> input_id;
67 std::string meteo_prefix, meteo_ext;
73 xmlParserCtxtPtr in_ctxt;
74 xmlXPathContextPtr in_xpathCtx;
75 xmlCharEncoding in_encoding;
77 static const double in_tz;
78 static const xmlChar* xml_attribute;
79 static const xmlChar* xml_namespace;
80 static const xmlChar* xml_namespace_abrev;
81 static const char* StationData_xpath;
82 static const char* MeteoData_xpath;
84 std::string coordin, coordinparam;
CosmoXMLIO & operator=(const CosmoXMLIO &)
Assignement operator, required because of pointer member.
Definition: CosmoXMLIO.cc:194
A class representing the IO Layer of the software Alpine3D. For each type of IO (File, DB, Webservice, etc) a derived class is to be created that holds the specific implementation of the appropriate virtual methods. The IOHandler class is a wrapper class that is able to deal with all above implementations of the IOInterface abstract base class.
Definition: IOInterface.h:43
~CosmoXMLIO()
Definition: CosmoXMLIO.cc:209
virtual void readStationData(const Date &date, std::vector< StationData > &vecStation)
Fill vecStation with StationData objects for a certain date of interest.
Definition: CosmoXMLIO.cc:429
Reading of FieldExtra XML meteorological data. This is the plugin for reading the XML data generated ...
Definition: CosmoXMLIO.h:38
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:475
CosmoXMLIO(const std::string &configfile)
Definition: CosmoXMLIO.cc:121
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:58
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:79
A class to represent meteo stations with attributes like longitude, latitude, etc.
Definition: StationData.h:38
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:101