MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GrassIO.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2009 EPFL */
3 /***********************************************************************************/
4 /* This file is part of MeteoIO.
5  MeteoIO is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  MeteoIO is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef GRASSIO_H
19 #define GRASSIO_H
20 
21 #include <meteoio/IOInterface.h>
22 
23 #include <string>
24 
25 namespace mio {
26 
35 class GrassIO : public IOInterface {
36  public:
37  GrassIO(const std::string& configfile);
38  GrassIO(const GrassIO&);
39  GrassIO(const Config&);
40 
41  using IOInterface::read2DGrid; //to call before overwriding the method
42  virtual void read2DGrid(Grid2DObject& dem_out, const std::string& parameter="");
43 
44  virtual void readDEM(DEMObject& dem_out);
45  virtual void readLanduse(Grid2DObject& landuse_out);
46  virtual void readAssimilationData(const Date&, Grid2DObject& da_out);
47 
48  using IOInterface::write2DGrid; //to call before overwriding the method
49  virtual void write2DGrid(const Grid2DObject& grid_in, const std::string& filename);
50 
51  private:
52  const Config cfg;
53  static const double plugin_nodata;
54  std::string coordin, coordinparam, coordout, coordoutparam; //projection parameters
55 };
56 
57 } //end namespace mio
58 
59 #endif
virtual void readDEM(DEMObject &dem_out)
Parse the DEM (Digital Elevation Model) into the Grid2DObject.
Definition: GrassIO.cc:154
This class enables the access to 2D grids stored in GRASS ASCII (e.g. JGrass) format.
Definition: GrassIO.h:35
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
virtual void write2DGrid(const Grid2DObject &grid_out, const std::string &options="")
Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins.
Definition: IOInterface.cc:126
virtual void readLanduse(Grid2DObject &landuse_out)
Parse the landuse model into the Grid2DObject.
Definition: GrassIO.cc:161
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 represent DEMs and automatically compute some properties. This class stores elevation grid...
Definition: DEMObject.h:39
virtual void read2DGrid(Grid2DObject &grid_out, const std::string &parameter="")
A generic function for parsing 2D grids into a Grid2DObject. The string parameter shall be used for a...
Definition: IOInterface.cc:69
A class to represent 2D Grids. Typical application as DEM or Landuse Model.
Definition: Grid2DObject.h:37
virtual void write2DGrid(const Grid2DObject &grid_in, const std::string &filename)
Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins.
Definition: GrassIO.cc:183
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:79
GrassIO(const std::string &configfile)
Definition: GrassIO.cc:52
virtual void readAssimilationData(const Date &, Grid2DObject &da_out)
Parse the assimilation data into a Grid2DObject for a certain date represented by the Date object...
Definition: GrassIO.cc:168
virtual void read2DGrid(Grid2DObject &dem_out, const std::string &parameter="")
A generic function for parsing 2D grids into a Grid2DObject. The string parameter shall be used for a...
Definition: GrassIO.cc:64