ReferenceFrame.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk 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
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
39 #include "ReferenceFrame.hpp"
40 
41 using namespace std;
42 
43 namespace gnsstk
44 {
45  namespace StringUtils
46  {
47  std::string asString(ReferenceFrame e)
48  {
49  switch (e)
50  {
51  case ReferenceFrame::Unknown: return "Unknown";
52  case ReferenceFrame::WGS84: return "WGS84";
53  case ReferenceFrame::WGS84G730: return "WGS84(G730)";
54  case ReferenceFrame::WGS84G873: return "WGS84(G873)";
55  case ReferenceFrame::WGS84G1150: return "WGS84(G1150)";
56  case ReferenceFrame::WGS84G1674: return "WGS84(G1674)";
57  case ReferenceFrame::WGS84G1762: return "WGS84(G1762)";
58  case ReferenceFrame::ITRF: return "ITRF";
59  case ReferenceFrame::ITRF94: return "ITRF(1994)";
60  case ReferenceFrame::ITRF96: return "ITRF(1996)";
61  case ReferenceFrame::ITRF97: return "ITRF(1997)";
62  case ReferenceFrame::ITRF2000: return "ITRF(2000)";
63  case ReferenceFrame::ITRF2005: return "ITRF(2005)";
64  case ReferenceFrame::ITRF2008: return "ITRF(2008)";
65  case ReferenceFrame::ITRF2014: return "ITRF(2014)";
66  case ReferenceFrame::PZ90: return "PZ90";
67  case ReferenceFrame::PZ90KGS: return "PZ90KGS";
68  case ReferenceFrame::CGCS2000: return "CGCS2000";
69  default: return "???";
70  }
71  }
72 
73 
74  ReferenceFrame asReferenceFrame(const std::string& s)
75  {
76  if (s == "Unknown") return ReferenceFrame::Unknown;
77  if (s == "WGS84") return ReferenceFrame::WGS84;
78  if (s == "WGS84(G730)") return ReferenceFrame::WGS84G730;
79  if (s == "WGS84(G873)") return ReferenceFrame::WGS84G873;
80  if (s == "WGS84(G1150)") return ReferenceFrame::WGS84G1150;
81  if (s == "WGS84(G1674)") return ReferenceFrame::WGS84G1674;
82  if (s == "WGS84(G1762)") return ReferenceFrame::WGS84G1762;
83  if (s == "ITRF") return ReferenceFrame::ITRF;
84  if (s == "ITRF(1994)") return ReferenceFrame::ITRF94;
85  if (s == "ITRF(1996)") return ReferenceFrame::ITRF96;
86  if (s == "ITRF(1997)") return ReferenceFrame::ITRF97;
87  if (s == "ITRF(2000)") return ReferenceFrame::ITRF2000;
88  if (s == "ITRF(2005)") return ReferenceFrame::ITRF2005;
89  if (s == "ITRF(2008)") return ReferenceFrame::ITRF2008;
90  if (s == "ITRF(2014)") return ReferenceFrame::ITRF2014;
91  if (s == "PZ90") return ReferenceFrame::PZ90;
92  if (s == "PZ90KGS") return ReferenceFrame::PZ90KGS;
93  if (s == "CGCS2000") return ReferenceFrame::CGCS2000;
94  // strings as they (probably) appear in SP3
95  if (s == "ITR94") return ReferenceFrame::ITRF94;
96  if (s == "ITR96") return ReferenceFrame::ITRF96;
97  if (s == "ITR97") return ReferenceFrame::ITRF97;
98  return ReferenceFrame::Unknown;
99  }
100  }
101 } // end namespace
gnsstk::ReferenceFrame
ReferenceFrame
Definition: ReferenceFrame.hpp:52
gnsstk::StringUtils::asReferenceFrame
ReferenceFrame asReferenceFrame(const std::string &s)
Convert a string representation of ReferenceFrame to an enum.
Definition: ReferenceFrame.cpp:74
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::StringUtils::asString
std::string asString(ReferenceFrame e)
Convert a ReferenceFrame enum to its string representation.
Definition: ReferenceFrame.cpp:47
std
Definition: Angle.hpp:142
ReferenceFrame.hpp


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:40