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.
- Author
- Thomas Egger
- Date
- 2009-01-08
|
virtual | ~IOInterface () |
|
virtual void | read2DGrid (Grid2DObject &grid_out, const std::string ¶meter="") |
| A generic function for parsing 2D grids into a Grid2DObject. The string parameter shall be used for addressing the specific 2D grid to be parsed into the Grid2DObject, relative to GRID2DPATH for most plugins. More...
|
|
virtual void | read2DGrid (Grid2DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
| Read the given meteo parameter into a Grid2DObject. Each plugin has its own logic for finding the requested meteo parameter grid relative to GRID2DPATH for most plugins. More...
|
|
virtual void | read3DGrid (Grid3DObject &grid_out, const std::string ¶meter="") |
| A generic function for parsing 3D grids into a Grid3DObject. The string parameter shall be used for addressing the specific 3D grid to be parsed into the Grid3DObject, relative to GRID3DPATH for most plugins. More...
|
|
virtual void | read3DGrid (Grid3DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
| Read the given meteo parameter into a Grid3DObject. Each plugin has its own logic for finding the requested meteo parameter grid relative to GRID3DPATH for most plugins. More...
|
|
virtual void | readDEM (DEMObject &dem_out) |
| Parse the DEM (Digital Elevation Model) into the Grid2DObject. More...
|
|
virtual void | readLanduse (Grid2DObject &landuse_out) |
| Parse the landuse model into the Grid2DObject. More...
|
|
virtual void | readStationData (const Date &date, std::vector< StationData > &vecStation) |
| Fill vecStation with StationData objects for a certain date of interest. More...
|
|
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 dateEnd. More...
|
|
virtual void | writeMeteoData (const std::vector< std::vector< MeteoData > > &vecMeteo, const std::string &name="") |
| Write vecMeteo time series to a certain destination. More...
|
|
virtual void | readAssimilationData (const Date &date_in, Grid2DObject &da_out) |
| Parse the assimilation data into a Grid2DObject for a certain date represented by the Date object. More...
|
|
virtual void | readPOI (std::vector< Coords > &pts) |
| Read a list of points by their grid coordinates This allows for example to get a list of points where to produce more detailed outputs. More...
|
|
virtual void | write2DGrid (const Grid2DObject &grid_out, const std::string &options="") |
| Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins. More...
|
|
virtual void | write2DGrid (const Grid2DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
| Write a Grid2DObject comtaining a known meteorological parameter A filename is build relative to GRID2DPATH for most plugins. More...
|
|
virtual void | write3DGrid (const Grid3DObject &grid_out, const std::string &options="") |
| Write a Grid3DObject The filename is specified relative to GRID3DPATH for most plugins. More...
|
|
virtual void | write3DGrid (const Grid3DObject &grid_out, const MeteoGrids::Parameters ¶meter, const Date &date) |
| Write a Grid3DObject comtaining a known meteorological parameter A filename is build relative to GRID3DPATH for most plugins. More...
|
|
void mio::IOInterface::readMeteoData |
( |
const Date & |
dateStart, |
|
|
const Date & |
dateEnd, |
|
|
std::vector< std::vector< MeteoData > > & |
vecMeteo |
|
) |
| |
|
virtual |
Fill vecMeteo with a time series of objects corresponding to the interval indicated by dateStart and dateEnd.
Matching rules:
- if dateStart and dateEnd are the same: return exact match for date
- if dateStart > dateEnd: return first data set with date > dateStart
- read in all data starting with dateStart until dateEnd
- if there is no data at all then the vectors will be empty, no exception will be thrown
Example Usage:
vector< vector<MeteoData> > vecMeteo;
Date d1(2008,06,21,11,00);
Date d2(2008,07,21,11,00);
IOHandler io1("io.ini");
io1.readMeteoData(d1, d2, vecMeteo);
- Parameters
-
dateStart | A Date object representing the beginning of an interval (inclusive) |
dateEnd | A Date object representing the end of an interval (inclusive) |
vecMeteo | A vector of vector<MeteoData> objects to be filled with data |
Reimplemented in mio::ImisIO, mio::GRIBIO, mio::CosmoXMLIO, mio::GSNIO, mio::SMETIO, mio::DBO, mio::PSQLIO, mio::ALPUG, mio::BormaIO, mio::OshdIO, mio::SNIO, mio::CNRMIO, mio::GeotopIO, mio::SASEIO, and mio::A3DIO.
void mio::IOInterface::readStationData |
( |
const Date & |
date, |
|
|
std::vector< StationData > & |
vecStation |
|
) |
| |
|
virtual |
Fill vecStation with StationData objects for a certain date of interest.
Example Usage:
vector<StationData> vecStation;
Date d1(2008,06,21,11,00);
IOHandler io1("io.ini");
io1.readStationData(d1, vecStation);
- Parameters
-
date | A Date object representing the date for which the meta data is to be fetched |
vecStation | A vector of StationData objects to be filled with meta data |
Reimplemented in mio::ImisIO, mio::CosmoXMLIO, mio::GSNIO, mio::SMETIO, mio::DBO, mio::PSQLIO, mio::ALPUG, mio::SNIO, mio::CNRMIO, mio::GeotopIO, mio::OshdIO, mio::SASEIO, and mio::A3DIO.
void mio::IOInterface::writeMeteoData |
( |
const std::vector< std::vector< MeteoData > > & |
vecMeteo, |
|
|
const std::string & |
name = "" |
|
) |
| |
|
virtual |
Write vecMeteo time series to a certain destination.
Example Usage: Configure the io.ini to use a certain plugin for the output:
METEODEST = GEOTOP
METEODESTPATH = /tmp
METEODESTSEQ = Iprec SWglobal
An example implementation (reading and writing):
vector< vector<MeteoData> > vecMeteo;
Date d1(2008,06,21,11,00);
Date d2(2008,07,21,11,00);
IOHandler io1("io.ini");
io1.readMeteoData(d1, d2, vecMeteo);
io1.writeMeteoData(vecMeteo)
- Parameters
-
vecMeteo | A vector of vector<MeteoData> objects to be filled with data |
name | (optional string) Identifier usefull for the output plugin (it could become part of a file name, a db table, etc) |
Reimplemented in mio::SMETIO, mio::PSQLIO, mio::SNIO, mio::CNRMIO, mio::GeotopIO, and mio::A3DIO.