MI - Fimex
ProjectionImpl.h
Go to the documentation of this file.
1 /*
2  * Fimex, ProjectionImpl.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 PROJECTIONIMPL_H_
28 #define PROJECTIONIMPL_H_
29 
35 namespace MetNoFimex
36 {
37 
48 {
49 public:
50  virtual ~ProjectionImpl();
52  virtual void addParameter(CDMAttribute attribute);
53  virtual void addParameters(std::vector<CDMAttribute> attributes);
54  virtual void removeParameter(std::string paramName);
56  virtual const std::string& getName() const;
57  virtual bool isDegree() const;
58 
66  virtual std::string getProj4String() const;
70  virtual std::string getProj4EarthString() const;
72  virtual std::string toString() const;
73 protected:
75  static bool proj4ProjectionMatchesName(const std::string& proj4String, const std::string& name);
81  static void proj4GetEarthAttributes(const std::string& proj4String, std::vector<CDMAttribute>& attrList);
82  // set the name of the projection and assign the isDegree parameter
83  explicit ProjectionImpl(std::string name, bool isDegree);
97  bool addParameterToStream(std::ostream& outStream, const std::string& name, std::string replaceName = "") const;
99 private:
100  const std::string name_;
101  const bool isDegree_;
102 };
103 
104 }
105 
106 #endif /* PROJECTIONIMPL_H_ */
virtual void addParameters(std::vector< CDMAttribute > attributes)
virtual std::string getProj4EarthString() const
basic_string< char > string
virtual std::ostream & getProj4ProjectionPart(std::ostream &) const =0
Definition: Projection.h:45
virtual std::string toString() const
virtual bool isDegree() const
static bool proj4ProjectionMatchesName(const std::string &proj4String, const std::string &name)
basic_ostream< char > ostream
static void proj4GetEarthAttributes(const std::string &proj4String, std::vector< CDMAttribute > &attrList)
virtual std::vector< CDMAttribute > getParameters() const
STL class.
ProjectionImpl(std::string name, bool isDegree)
Definition: C_CDMReader.h:35
Definition: CDMAttribute.h:43
virtual void removeParameter(std::string paramName)
bool addParameterToStream(std::ostream &outStream, const std::string &name, std::string replaceName="") const
virtual const std::string & getName() const
virtual void addParameter(CDMAttribute attribute)
virtual std::string getProj4String() const
std::vector< CDMAttribute > params_
Definition: ProjectionImpl.h:98
Definition: ProjectionImpl.h:47