MeteoIODoc 20240427.aefd3c94
GrassIO.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2009 EPFL */
4/***********************************************************************************/
5/* This file is part of MeteoIO.
6 MeteoIO is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 MeteoIO is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef GRASSIO_H
20#define GRASSIO_H
21
22#include <meteoio/IOInterface.h>
23
24#include <string>
25
26namespace mio {
27
36class GrassIO : public IOInterface {
37 public:
38 GrassIO(const std::string& configfile);
40 GrassIO(const Config&);
41
42 virtual bool list2DGrids(const Date& /*start*/, const Date& /*end*/, std::map<Date, std::set<size_t> >& /*list*/) {return false;}
43 using IOInterface::read2DGrid; //to call before overriding the method
44 virtual void read2DGrid(Grid2DObject& dem_out, const std::string& parameter="");
45
46 virtual void readDEM(DEMObject& dem_out);
47 virtual void readLanduse(Grid2DObject& landuse_out);
48 virtual void readGlacier(Grid2DObject& glacier_out);
49
50 virtual void readAssimilationData(const Date&, Grid2DObject& da_out);
51
52 using IOInterface::write2DGrid; //to call before overriding the method
53 virtual void write2DGrid(const Grid2DObject& grid_in, const std::string& options);
54
55 private:
56 const Config cfg;
57 static const double plugin_nodata;
58 std::string coordin, coordinparam, coordout, coordoutparam; //projection parameters
59};
60
61} //end namespace mio
62
63#endif
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
A class to represent DEMs and automatically compute some properties. This class stores elevation grid...
Definition: DEMObject.h:40
A class to handle timestamps. This class handles conversion between different time display formats (I...
Definition: Date.h:87
This class enables the access to 2D grids stored in GRASS ASCII (e.g. JGrass) format.
Definition: GrassIO.h:36
virtual bool list2DGrids(const Date &, const Date &, std::map< Date, std::set< size_t > > &)
Return the list of grids within a given time period that could be read by the plugin,...
Definition: GrassIO.h:42
virtual void readLanduse(Grid2DObject &landuse_out)
Parse the landuse model into the Grid2DObject.
Definition: GrassIO.cc:159
GrassIO(const GrassIO &)
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:173
virtual void readDEM(DEMObject &dem_out)
Parse the DEM (Digital Elevation Model) into the Grid2DObject.
Definition: GrassIO.cc:152
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:67
virtual void write2DGrid(const Grid2DObject &grid_in, const std::string &options)
Write a Grid2DObject The filename is specified relative to GRID2DPATH for most plugins.
Definition: GrassIO.cc:188
virtual void readGlacier(Grid2DObject &glacier_out)
Parse the input glacier grid into the Grid2DObject.
Definition: GrassIO.cc:166
GrassIO(const std::string &configfile)
Definition: GrassIO.cc:55
A class to represent 2D Grids. Typical application as DEM or Landuse Model.
Definition: Grid2DObject.h:42
A class representing the IO Layer of the software Alpine3D. For each type of IO (File,...
Definition: IOInterface.h:98
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:146
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:76
Definition: Config.cc:31