Goby v2
moos_geodesy.h
1 // Copyright 2009-2018 Toby Schneider (http://gobysoft.org/index.wt/people/toby)
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 //
6 //
7 // This file is part of the Goby Underwater Autonomy Project Libraries
8 // ("The Goby Libraries").
9 //
10 // The Goby Libraries are free software: you can redistribute them and/or modify
11 // them under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 2.1 of the License, or
13 // (at your option) any later version.
14 //
15 // The Goby Libraries are distributed in the hope that they will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with Goby. If not, see <http://www.gnu.org/licenses/>.
22 
23 // This file uses the same basic API provided by MOOS pre-v10
24 // (C) Paul Newman, released GPL v3
25 
26 #ifndef MOOSGeodesy20130916H
27 #define MOOSGeodesy20130916H
28 
29 #include <proj_api.h>
30 
32 {
33  public:
34  CMOOSGeodesy();
35  virtual ~CMOOSGeodesy();
36 
37  double GetOriginLatitude();
38  double GetOriginLongitude();
39  double GetOriginNorthing();
40  double GetOriginEasting();
41  int GetUTMZone();
42 
43  bool LatLong2LocalUTM(double lat, double lon, double& MetersNorth, double& MetersEast);
44  bool UTM2LatLong(double dfX, double dfY, double& dfLat, double& dfLong);
45 
46  bool Initialise(double lat, double lon);
47 
48  private:
49  int m_sUTMZone;
50  double m_dOriginEasting;
51  double m_dOriginNorthing;
52  double m_dOriginLongitude;
53  double m_dOriginLatitude;
54  projPJ pj_utm_, pj_latlong_;
55 
56  void SetOriginLatitude(double lat);
57  void SetOriginLongitude(double lon);
58  void SetOriginEasting(double East);
59  void SetOriginNorthing(double North);
60  void SetUTMZone(int zone);
61 };
62 
63 #endif