dotnet/NETGeographicLib/LambertConformalConic.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "LambertConformalConic.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 const char BADALLOC[] = "Failed to allocte memory for a GeographicLib::LambertConformalConic";
19 
20 //*****************************************************************************
22 {
23  if ( m_pLambertConformalConic != NULL )
24  {
25  delete m_pLambertConformalConic;
26  m_pLambertConformalConic = NULL;
27  }
28 }
29 
30 //*****************************************************************************
31 LambertConformalConic::LambertConformalConic(double a, double f, double stdlat,
32  double k0)
33 {
34  try
35  {
37  new GeographicLib::LambertConformalConic( a, f, stdlat, k0 );
38  }
39  catch ( std::bad_alloc )
40  {
41  throw gcnew GeographicErr( BADALLOC );
42  }
43  catch ( const std::exception& err )
44  {
45  throw gcnew GeographicErr( err.what() );
46  }
47 }
48 
49 //*****************************************************************************
51  double stdlat1, double stdlat2, double k1)
52 {
53  try
54  {
56  new GeographicLib::LambertConformalConic( a, f, stdlat1, stdlat2, k1 );
57  }
58  catch ( std::bad_alloc )
59  {
60  throw gcnew GeographicErr( BADALLOC );
61  }
62  catch ( const std::exception& err )
63  {
64  throw gcnew GeographicErr( err.what() );
65  }
66 }
67 
68 //*****************************************************************************
70  double sinlat1, double coslat1,
71  double sinlat2, double coslat2,
72  double k1)
73 {
74  try
75  {
77  new GeographicLib::LambertConformalConic( a, f, sinlat1, coslat1,
78  sinlat2, coslat2, k1 );
79  }
80  catch ( std::bad_alloc )
81  {
82  throw gcnew GeographicErr( BADALLOC );
83  }
84  catch ( const std::exception& err )
85  {
86  throw gcnew GeographicErr( err.what() );
87  }
88 }
89 
90 //*****************************************************************************
92 {
93  try
94  {
97  }
98  catch ( std::bad_alloc )
99  {
100  throw gcnew GeographicErr( BADALLOC );
101  }
102 }
103 
104 //*****************************************************************************
105 void LambertConformalConic::SetScale(double lat, double k)
106 {
107  try
108  {
110  }
111  catch ( std::exception err )
112  {
113  throw gcnew GeographicErr( err.what() );
114  }
115 }
116 
117 //*****************************************************************************
118 void LambertConformalConic::Forward(double lon0, double lat, double lon,
119  [System::Runtime::InteropServices::Out] double% x,
120  [System::Runtime::InteropServices::Out] double% y,
121  [System::Runtime::InteropServices::Out] double% gamma,
122  [System::Runtime::InteropServices::Out] double% k)
123 {
124  double lx, ly, lgamma, lk;
125  m_pLambertConformalConic->Forward( lon0, lat, lon, lx, ly, lgamma, lk );
126  x = lx;
127  y = ly;
128  gamma = lgamma;
129  k = lk;
130 }
131 
132 //*****************************************************************************
133 void LambertConformalConic::Reverse(double lon0, double x, double y,
134  [System::Runtime::InteropServices::Out] double% lat,
135  [System::Runtime::InteropServices::Out] double% lon,
136  [System::Runtime::InteropServices::Out] double% gamma,
137  [System::Runtime::InteropServices::Out] double% k)
138 {
139  double llat, llon, lgamma, lk;
140  m_pLambertConformalConic->Reverse( lon0, x, y, llat, llon, lgamma, lk );
141  lat = llat;
142  lon = llon;
143  gamma = lgamma;
144  k = lk;
145 }
146 
147 //*****************************************************************************
148 void LambertConformalConic::Forward(double lon0, double lat, double lon,
149  [System::Runtime::InteropServices::Out] double% x,
150  [System::Runtime::InteropServices::Out] double% y)
151 {
152  double lx, ly;
154  x = lx;
155  y = ly;
156 }
157 
158 //*****************************************************************************
159 void LambertConformalConic::Reverse(double lon0, double x, double y,
160  [System::Runtime::InteropServices::Out] double% lat,
161  [System::Runtime::InteropServices::Out] double% lon)
162 {
163  double llat, llon;
164  m_pLambertConformalConic->Reverse( lon0, x, y, llat, llon );
165  lat = llat;
166  lon = llon;
167 }
168 
169 //*****************************************************************************
171 { return m_pLambertConformalConic->MajorRadius(); }
172 
173 //*****************************************************************************
175 { return m_pLambertConformalConic->Flattening(); }
176 
177 //*****************************************************************************
179 { return m_pLambertConformalConic->OriginLatitude(); }
180 
181 //*****************************************************************************
183 { return m_pLambertConformalConic->CentralScale(); }
NETGeographicLib::LambertConformalConic::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/LambertConformalConic.cpp:133
GeographicLib::LambertConformalConic::Reverse
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
Definition: src/LambertConformalConic.cpp:373
NETGeographicLib::LambertConformalConic::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/LambertConformalConic.cpp:118
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
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
NETGeographicLib::LambertConformalConic::SetScale
void SetScale(double lat, double k)
Definition: dotnet/NETGeographicLib/LambertConformalConic.cpp:105
k0
double k0(double x)
Definition: k0.c:131
NETGeographicLib::LambertConformalConic::LambertConformalConic
LambertConformalConic()
Definition: dotnet/NETGeographicLib/LambertConformalConic.cpp:91
LambertConformalConic.hpp
Header for GeographicLib::LambertConformalConic class.
lgamma
const EIGEN_DEVICE_FUNC LgammaReturnType lgamma() const
Definition: ArrayCwiseUnaryOps.h:620
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
k1
double k1(double x)
Definition: k1.c:133
GeographicLib::LambertConformalConic::SetScale
void SetScale(real lat, real k=real(1))
Definition: src/LambertConformalConic.cpp:441
stdafx.h
GeographicLib::LambertConformalConic::Mercator
static const LambertConformalConic & Mercator()
Definition: src/LambertConformalConic.cpp:324
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
GeographicLib::LambertConformalConic::Forward
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
Definition: src/LambertConformalConic.cpp:331
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
GeographicLib::LambertConformalConic
Lambert conformal conic projection.
Definition: LambertConformalConic.hpp:63
NETGeographicLib::LambertConformalConic
.NET wrapper for GeographicLib::LambertConformalConic.
Definition: LambertConformalConic.h:65
lon
static const double lon
Definition: testGeographicLib.cpp:34
NULL
#define NULL
Definition: ccolamd.c:609
LambertConformalConic.h
Header for NETGeographicLib::LambertConformalConic class.
BADALLOC
const char BADALLOC[]
Definition: dotnet/NETGeographicLib/LambertConformalConic.cpp:18
get
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
NETGeographicLib
Definition: Accumulator.h:13
NETGeographicLib::LambertConformalConic::m_pLambertConformalConic
GeographicLib::LambertConformalConic * m_pLambertConformalConic
Definition: LambertConformalConic.h:69
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Mon Jul 1 2024 03:01:43