| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeDatum.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00027 #ifndef  __TERRALIB_INTERNAL_DATUM_H
    00028 #define  __TERRALIB_INTERNAL_DATUM_H
    00029
    00030 #include <string>
    00031 #include "TeUtils.h"
    00032
    00034 const int NUM_DATUM = 11;
    00035
    00036 TL_DLL const char** TeGetDatumList();
    00037
    00038
    00040
    00054 class TL_DLL TeDatum
    00055 {
    00056 private:
    00057            std::string           name_;
    00058            double     rd_,
    00059                                  flt_;
    00060 public:
    00061            double     dx_,
    00062                                  dy_,
    00063                                  dz_;
    00064
    00066            TeDatum ( std::string name = "Spherical", double rd = 6.371000e+06 , double flt = 0.,
    00067                                    double dx = 0., double dy= 0., double dz = 0.):
    00068            name_ ( name ),
    00069            rd_   (  rd  ),
    00070            flt_  ( flt  ),
    00071            dx_   (  dx  ),
    00072            dy_   (  dy  ),
    00073            dz_   (  dz  )
    00074            { }
    00075
    00077            TeDatum(const TeDatum& other);
    00078
    00080            TeDatum& operator=(const TeDatum& rhs);
    00081
    00083            ~TeDatum () {}
    00084
    00086            std::string           name()      const
    00087            { return name_;}
    00088
    00090            void name(const std::string& name)
    00091            {          name_ = name;         }
    00092
    00094            double radius() const
    00095            { return rd_; }
    00096
    00098            void radius(const double rd)
    00099            { rd_ = rd; }
    00100
    00102            double flattening() const
    00103            { return flt_; }
    00104
    00106            void flattening(const double flt)
    00107            { flt_ = flt; }
    00108
    00110            double     xShift() const
    00111            { return dx_; }
    00112
    00114            double  yShift() const
    00115            { return dy_; }
    00116
    00118            double zShift()  const
    00119            { return dz_; }
    00120
    00121
    00123            bool operator== (const TeDatum& dat) const
    00124            {
    00125                       return (TeFPEquals(rd_,dat.rd_,0.0000000001)
    00126                                     && TeFPEquals(flt_,dat.flt_,0.0000000001)
    00127                                     && TeFPEquals(dx_,dat.dx_,0.0000000001)
    00128                                     && TeFPEquals(dy_,dat.dy_,0.0000000001)
    00129                                     && TeFPEquals(dz_,dat.dz_,0.0000000001));
    00130            }
    00131
    00133            string getProj4Description();
    00134
    00136            string getWKTDescription();
    00137
    00138 };
    00139
    00140 typedef std::map<std::string, TeDatum> TeDatumMap;
    00141
    00143 class TL_DLL TeDatumFactory
    00144 {
    00145
    00146 protected:
    00147
    00148            static TeDatumMap     _datumMap;
    00149
    00150 public:
    00151
    00153            static     TeDatum make ( const std::string& name );
    00154
    00156            static TeDatum makeFromEPSGCode(const std::string epsgCode);
    00157
    00159            static TeDatum makeFromWKT(const std::string wktDatumDescription);
    00160
    00161            static void loadDatumMap();
    00162
    00163            static TeDatumMap& getDatumMap();
    00164 };
    00165
    00170 TL_DLL bool findDatum(double semiMajor, double flatenning, TeDatum& datum);
    00171
    00172 #endif
    00173

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines