MI - Fimex
Projection.h
Go to the documentation of this file.
1 /*
2  * Fimex, Projection.h
3  *
4  * (C) Copyright 2010, 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: Apr 27, 2010
24  * Author: Heiko Klein
25  */
26 
27 #ifndef PROJECTION_H_
28 #define PROJECTION_H_
29 
30 #include <vector>
31 #include <iostream>
32 #include <boost/shared_ptr.hpp>
33 #include "fimex/CDMAttribute.h"
34 
35 namespace MetNoFimex
36 {
37 
45 class Projection : public CDMNamedEntity
46 {
47 public:
48  virtual ~Projection() {}
49  virtual std::vector<CDMAttribute> getParameters() const = 0;
50  virtual void addParameter(CDMAttribute attribute) = 0;
51  virtual void addParameters(std::vector<CDMAttribute> attributes) = 0;
52  virtual void removeParameter(std::string paramName) = 0;
54  virtual const std::string& getName() const = 0;
56  virtual bool isDegree() const = 0;
58  virtual std::string getProj4String() const = 0;
62  virtual std::string getProj4EarthString() const = 0;
72  virtual void convertToLonLat(std::vector<double>& xVals, std::vector<double>& yVals) const throw(CDMException);
82  virtual void convertFromLonLat(std::vector<double>& xVals, std::vector<double>& yVals) const throw(CDMException);
87  virtual std::string toString() const = 0;
92  virtual bool operator==(const Projection& b) const;
94  static boost::shared_ptr<Projection> create(std::vector<CDMAttribute>);
96  static boost::shared_ptr<Projection> createByProj4(const std::string& projStr);
97 protected:
98  Projection() {};
99 };
100 
102 std::ostream& operator<<(std::ostream& out, const Projection& proj);
103 
112 std::string replaceProj4Earthfigure(const std::string& proj4, const std::string& newEarthfigure);
113 
114 } /* namespace MetNoFimex */
115 
116 #endif /* PROJECTION_H_ */
virtual ~Projection()
Definition: Projection.h:48
Definition: CDMNamedEntity.h:42
virtual void removeParameter(std::string paramName)=0
basic_string< char > string
virtual void addParameter(CDMAttribute attribute)=0
virtual std::string toString() const =0
Definition: Projection.h:45
static boost::shared_ptr< Projection > createByProj4(const std::string &projStr)
virtual bool isDegree() const =0
virtual bool operator==(const Projection &b) const
basic_ostream< char > ostream
Definition: CDMException.h:36
STL class.
virtual const std::string & getName() const =0
Definition: C_CDMReader.h:35
Definition: CDMAttribute.h:43
virtual std::vector< CDMAttribute > getParameters() const =0
std::ostream & operator<<(std::ostream &out, CoordinateAxis ca)
std::string replaceProj4Earthfigure(const std::string &proj4, const std::string &newEarthfigure)
virtual std::string getProj4String() const =0
virtual std::string getProj4EarthString() const =0
Projection()
Definition: Projection.h:98
static boost::shared_ptr< Projection > create(std::vector< CDMAttribute >)
virtual void convertFromLonLat(std::vector< double > &xVals, std::vector< double > &yVals) const
virtual void convertToLonLat(std::vector< double > &xVals, std::vector< double > &yVals) const
virtual void addParameters(std::vector< CDMAttribute > attributes)=0