MI - Fimex
GridDefinition.h
Go to the documentation of this file.
1 /*
2  * Fimex, GridDefinition.h
3  *
4  * (C) Copyright 2009, met.no
5  *
6  * Project Info: https://wiki.met.no/fimex/start
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21  * USA.
22  *
23  * Created on: Sep 10, 2009
24  * Author: Heiko Klein
25  */
26 
27 #ifndef GRIDDEFINITION_H_
28 #define GRIDDEFINITION_H_
29 
30 #include "fimex/binaryConstants.h"
31 #include <string>
32 #include "boost/shared_ptr.hpp"
33 
34 namespace MetNoFimex
35 {
36 
37 // forward declaration
38 struct GridDefImpl;
39 
41 {
42 public:
54  };
55  // grib2 binary representations
56  enum Orientation {
65 
74  };
75 
78  std::string projDefinition,
79  bool isDegree,
80  size_t xSize,
81  size_t ySize,
82  double xIncr,
83  double yIncr,
84  double xStart,
85  double yStart,
86  Orientation orient);
87  virtual ~GridDefinition();
89  virtual std::string getProjDefinition() const;
90  virtual void setProjDefinition(std::string proj);
91  // check if start and increment are degree or metric
92  virtual bool isDegree() const;
93  virtual void setDegree(bool isDegree);
95  virtual size_t getXSize() const;
96  virtual void setXSize(size_t xSize);
98  virtual size_t getYSize() const;
99  virtual void setYSize(size_t ySize);
101  virtual double getXIncrement() const;
102  virtual void setXIncrement(double xIncr);
104  virtual double getYIncrement() const;
105  virtual void setYIncrement(double yIncr);
107  virtual double getXStart() const;
108  virtual void setXStart(double startX);
110  virtual double getYStart() const;
111  virtual void setYStart(double startY);
112  virtual Orientation getScanMode() const;
113  virtual void setScanMode(Orientation orient);
114 
124  virtual bool comparableTo(const GridDefinition& rhs, double delta = 0.) const;
125 
133  std::string id() const;
138  bool operator<(const GridDefinition& rhs) const;
139 
140 private:
141  boost::shared_ptr<GridDefImpl> gridDef;
142 
143 };
144 
145 }
146 
147 #endif /* GRIDDEFINITION_H_ */
basic_string< char > string
virtual void setProjDefinition(std::string proj)
virtual double getXStart() const
x or longitude start in m or degree
Definition: GridDefinition.h:50
bool operator<(const GridDefinition &rhs) const
virtual size_t getYSize() const
number of points in y or latitude direction
virtual void setYStart(double startY)
virtual void setDegree(bool isDegree)
virtual void setXIncrement(double xIncr)
virtual void setXSize(size_t xSize)
Definition: GridDefinition.h:40
Definition: C_CDMReader.h:35
virtual double getYStart() const
y or latitude start in m or degree
OrientationFlags
Definition: GridDefinition.h:48
virtual double getYIncrement() const
y or latitude increment in m or degree
Definition: GridDefinition.h:62
virtual double getXIncrement() const
x or longitude increment in m or degree
virtual bool comparableTo(const GridDefinition &rhs, double delta=0.) const
std::string id() const
Definition: GridDefinition.h:49
virtual bool isDegree() const
virtual void setXStart(double startX)
virtual Orientation getScanMode() const
Definition: GridDefinition.h:63
virtual std::string getProjDefinition() const
return a proj4 string
virtual size_t getXSize() const
number of points in x or longitude direction
Orientation
Definition: GridDefinition.h:56
Definition: GridDefinition.h:61
change direction between succeeding rows (horizontal) or columns (vertical)
Definition: GridDefinition.h:53
virtual void setYIncrement(double yIncr)
Definition: GridDefinition.h:51
Definition: binaryConstants.h:40
virtual void setYSize(size_t ySize)
virtual void setScanMode(Orientation orient)
Definition: GridDefinition.h:64