All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ellipsoid.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib 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,
8  or (at your option) any later version.
9 
10  TerraLib 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 TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/srs/Ellipsoid.cpp
22  */
23 
24 // TerraLib
25 #include "../common/Translator.h"
26 #include "Ellipsoid.h"
27 
28 // STL
29 #include <sstream>
30 
31 te::srs::Ellipsoid::Ellipsoid(const std::string& name, double rad, double invflat):
32  m_name(name),
33  m_radium(rad),
34  m_invFlattening(invflat)
35 {}
36 
37 const std::string& te::srs::Ellipsoid::getName() const
38 {
39  return m_name;
40 }
41 
42 void te::srs::Ellipsoid::setName(const std::string& name)
43 {
44  m_name = name;
45 }
46 
48 {
49  return m_radium;
50 }
51 
52 void te::srs::Ellipsoid::setRadium(const double& rad)
53 {
54  m_radium = rad;
55 }
56 
58 {
59  return m_invFlattening;
60 }
61 
62 void te::srs::Ellipsoid::setInverseFlattening(const double& invflat)
63 {
64  m_invFlattening = invflat;
65 }
66 
67 std::string
69 {
70  std::ostringstream sstr;
71  sstr.precision(10);
72 
73  std::string wkt = "SPHEROID[\"";
74  wkt += m_name;
75  wkt += "\",";
76  sstr << m_radium;
77  wkt += sstr.str();
78  wkt += ",";
79  sstr.str("");
80  sstr << m_invFlattening;
81  wkt += sstr.str();
82  wkt += "]";
83  return wkt;
84 }
85 
void setRadium(const double &rad)
Sets the Ellipsoid radium.
Definition: Ellipsoid.cpp:52
void setName(const std::string &name)
Sets the Ellipsoid name.
Definition: Ellipsoid.cpp:42
std::string getWKT() const
Returns a WKT string that represents the ellipsoid.
Definition: Ellipsoid.cpp:68
Ellipsoid(const std::string &name="", double rad=0.0, double invflat=0.0)
Constructor with parameters.
Definition: Ellipsoid.cpp:31
void setInverseFlattening(const double &invflat)
Sets the Ellipsoid inverse flattening.
Definition: Ellipsoid.cpp:62
double getInverseFlattening() const
Returns the Ellipsoid inverse flattening.
Definition: Ellipsoid.cpp:57
double getRadium() const
Returns the Ellipsoid radium.
Definition: Ellipsoid.cpp:47
const std::string & getName() const
Returns the Ellipsoid name.
Definition: Ellipsoid.cpp:37
This file contains the structs necessary to model an Ellipsoid.