dotnet/NETGeographicLib/TransverseMercator.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "TransverseMercator.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::TransverseMercator";
19 
20 //*****************************************************************************
22 {
23  if ( m_pTransverseMercator != NULL )
24  {
25  delete m_pTransverseMercator;
26  m_pTransverseMercator = NULL;
27  }
28 }
29 
30 //*****************************************************************************
32 {
33  try
34  {
36  }
37  catch (std::bad_alloc )
38  {
39  throw gcnew GeographicErr( BADALLOC );
40  }
41  catch (std::exception err )
42  {
43  throw gcnew GeographicErr( err.what() );
44  }
45 }
46 
47 //*****************************************************************************
49 {
50  try
51  {
54  }
55  catch (std::bad_alloc )
56  {
57  throw gcnew GeographicErr( BADALLOC );
58  }
59 }
60 
61 //*****************************************************************************
62 void TransverseMercator::Forward(double lon0, double lat, double lon,
63  [System::Runtime::InteropServices::Out] double% x,
64  [System::Runtime::InteropServices::Out] double% y,
65  [System::Runtime::InteropServices::Out] double% gamma,
66  [System::Runtime::InteropServices::Out] double% k)
67 {
68  double lx, ly, lgamma, lk;
69  m_pTransverseMercator->Forward( lon0, lat, lon, lx, ly, lgamma, lk );
70  x = lx;
71  y = ly;
72  gamma = lgamma;
73  k = lk;
74 }
75 
76 //*****************************************************************************
77 void TransverseMercator::Reverse(double lon0, double x, double y,
78  [System::Runtime::InteropServices::Out] double% lat,
79  [System::Runtime::InteropServices::Out] double% lon,
80  [System::Runtime::InteropServices::Out] double% gamma,
81  [System::Runtime::InteropServices::Out] double% k)
82 {
83  double llat, llon, lgamma, lk;
84  m_pTransverseMercator->Reverse( lon0, x, y, llat, llon, lgamma, lk );
85  lat = llat;
86  lon = llon;
87  gamma = lgamma;
88  k = lk;
89 }
90 
91 //*****************************************************************************
92 void TransverseMercator::Forward(double lon0, double lat, double lon,
93  [System::Runtime::InteropServices::Out] double% x,
94  [System::Runtime::InteropServices::Out] double% y)
95 {
96  double lx, ly;
98  x = lx;
99  y = ly;
100 }
101 
102 //*****************************************************************************
103 void TransverseMercator::Reverse(double lon0, double x, double y,
104  [System::Runtime::InteropServices::Out] double% lat,
105  [System::Runtime::InteropServices::Out] double% lon)
106 {
107  double llat, llon;
108  m_pTransverseMercator->Reverse( lon0, x, y, llat, llon );
109  lat = llat;
110  lon = llon;
111 }
112 
113 //*****************************************************************************
115 { return m_pTransverseMercator->MajorRadius(); }
116 
117 //*****************************************************************************
119 { return m_pTransverseMercator->Flattening(); }
120 
121 //*****************************************************************************
123 { return m_pTransverseMercator->CentralScale(); }
TransverseMercator.h
Header for NETGeographicLib::TransverseMercator class.
NETGeographicLib::TransverseMercator
.NET wrapper for GeographicLib::TransverseMercator.
Definition: TransverseMercator.h:77
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
GeographicLib::TransverseMercator::UTM
static const TransverseMercator & UTM()
Definition: src/TransverseMercator.cpp:277
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
k0
double k0(double x)
Definition: k0.c:131
NETGeographicLib::TransverseMercator::Forward
void Forward(double lon0, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/TransverseMercator.cpp:62
TransverseMercator.hpp
Header for GeographicLib::TransverseMercator class.
NETGeographicLib::TransverseMercator::m_pTransverseMercator
const GeographicLib::TransverseMercator * m_pTransverseMercator
Definition: TransverseMercator.h:81
lgamma
const EIGEN_DEVICE_FUNC LgammaReturnType lgamma() const
Definition: ArrayCwiseUnaryOps.h:620
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
GeographicLib::TransverseMercator::Forward
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
Definition: src/TransverseMercator.cpp:350
stdafx.h
gamma
#define gamma
Definition: mconf.h:85
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
y
Scalar * y
Definition: level1_cplx_impl.h:124
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
GeographicLib::TransverseMercator::Reverse
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
Definition: src/TransverseMercator.cpp:516
NETGeographicLib::TransverseMercator::TransverseMercator
TransverseMercator()
Definition: dotnet/NETGeographicLib/TransverseMercator.cpp:48
lon
static const double lon
Definition: testGeographicLib.cpp:34
NETGeographicLib::TransverseMercator::Reverse
void Reverse(double lon0, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/TransverseMercator.cpp:77
NULL
#define NULL
Definition: ccolamd.c:609
BADALLOC
const char BADALLOC[]
Definition: dotnet/NETGeographicLib/TransverseMercator.cpp:18
get
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
NETGeographicLib
Definition: Accumulator.h:13
GeographicLib::TransverseMercator
Transverse Mercator projection.
Definition: TransverseMercator.hpp:93
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:18:05