dotnet/NETGeographicLib/OSGB.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
12 #include "GeographicLib/OSGB.hpp"
13 #include "OSGB.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 //*****************************************************************************
19 void OSGB::Forward(double lat, double lon,
20  [System::Runtime::InteropServices::Out] double% x,
21  [System::Runtime::InteropServices::Out] double% y,
22  [System::Runtime::InteropServices::Out] double% gamma,
23  [System::Runtime::InteropServices::Out] double% k)
24 {
25  double lx, ly, lgamma, lk;
26  GeographicLib::OSGB::Forward( lat, lon, lx, ly, lgamma, lk );
27  x = lx;
28  y = ly;
29  gamma = lgamma;
30  k = lk;
31 }
32 
33 //*****************************************************************************
34 void OSGB::Reverse(double x, double y,
35  [System::Runtime::InteropServices::Out] double% lat,
36  [System::Runtime::InteropServices::Out] double% lon,
37  [System::Runtime::InteropServices::Out] double% gamma,
38  [System::Runtime::InteropServices::Out] double% k)
39 {
40  double llat, llon, lgamma, lk;
41  GeographicLib::OSGB::Reverse( x, y, llat, llon, lgamma, lk );
42  lat = llat;
43  lon = llon;
44  gamma = lgamma;
45  k = lk;
46 }
47 
48 //*****************************************************************************
49 void OSGB::Forward(double lat, double lon,
50  [System::Runtime::InteropServices::Out] double% x,
51  [System::Runtime::InteropServices::Out] double% y)
52 {
53  double lx, ly;
55  x = lx;
56  y = ly;
57 }
58 
59 //*****************************************************************************
60 void OSGB::Reverse(double x, double y,
61  [System::Runtime::InteropServices::Out] double% lat,
62  [System::Runtime::InteropServices::Out] double% lon)
63 {
64  double llat, llon;
65  GeographicLib::OSGB::Reverse( x, y, llat, llon );
66  lat = llat;
67  lon = llon;
68 }
69 
70 //*****************************************************************************
71 void OSGB::GridReference(double x, double y, int prec,
72  [System::Runtime::InteropServices::Out] System::String^% gridref)
73 {
74  try
75  {
76  std::string lgridref;
77  GeographicLib::OSGB::GridReference( x, y, prec, lgridref );
78  gridref = gcnew System::String( lgridref.c_str() );
79  }
80  catch ( std::bad_alloc )
81  {
82  throw gcnew GeographicErr( "Memory allocation error in OSGB::GridReference" );
83  }
84  catch ( const std::exception& err )
85  {
86  throw gcnew GeographicErr( err.what() );
87  }
88 }
89 
90 //*****************************************************************************
91 void OSGB::GridReference(System::String^ gridref,
92  [System::Runtime::InteropServices::Out] double% x,
93  [System::Runtime::InteropServices::Out] double% y,
94  [System::Runtime::InteropServices::Out] int% prec,
95  bool centerp )
96 {
97  try
98  {
99  double lx, ly;
100  int lprec;
103  lx, ly, lprec, centerp );
104  x = lx;
105  y = ly;
106  prec = lprec;
107  }
108  catch ( const std::exception& err )
109  {
110  throw gcnew GeographicErr( err.what() );
111  }
112 }
113 
114 //*****************************************************************************
116 
117 //*****************************************************************************
119 
120 //*****************************************************************************
122 
123 //*****************************************************************************
125 
126 //*****************************************************************************
129 
130 //*****************************************************************************
132 
133 //*****************************************************************************
OSGB.h
Header for NETGeographicLib::OSGB class.
GeographicLib::OSGB::OriginLatitude
static Math::real OriginLatitude()
Definition: OSGB.hpp:222
NETGeographicLib::OSGB::MajorRadius
static double MajorRadius()
Definition: dotnet/NETGeographicLib/OSGB.cpp:115
NETGeographicLib::OSGB::CentralScale
static double CentralScale()
Definition: dotnet/NETGeographicLib/OSGB.cpp:121
GeographicLib::OSGB::FalseNorthing
static Math::real FalseNorthing()
Definition: OSGB.hpp:233
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::OSGB::Forward
static void Forward(real lat, real lon, real &x, real &y, real &gamma, real &k)
Definition: OSGB.hpp:81
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
NETGeographicLib::OSGB::Flattening
static double Flattening()
Definition: dotnet/NETGeographicLib/OSGB.cpp:118
NETGeographicLib::OSGB::FalseNorthing
static double FalseNorthing()
Definition: dotnet/NETGeographicLib/OSGB.cpp:131
GeographicLib::OSGB::GridReference
static void GridReference(real x, real y, int prec, std::string &gridref)
Definition: src/OSGB.cpp:34
GeographicLib::OSGB::Flattening
static Math::real Flattening()
Definition: OSGB.hpp:205
GeographicLib::OSGB::CentralScale
static Math::real CentralScale()
Definition: OSGB.hpp:214
lgamma
const EIGEN_DEVICE_FUNC LgammaReturnType lgamma() const
Definition: ArrayCwiseUnaryOps.h:620
OSGB.hpp
Header for GeographicLib::OSGB class.
NETGeographicLib::OSGB::Reverse
static void Reverse(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/OSGB.cpp:34
stdafx.h
gamma
#define gamma
Definition: mconf.h:85
GeographicLib::OSGB::Reverse
static void Reverse(real x, real y, real &lat, real &lon, real &gamma, real &k)
Definition: OSGB.hpp:102
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
y
Scalar * y
Definition: level1_cplx_impl.h:124
NETGeographicLib::OSGB::GridReference
static void GridReference(double x, double y, int prec, [System::Runtime::InteropServices::Out] System::String^% gridref)
Definition: dotnet/NETGeographicLib/OSGB.cpp:71
NETGeographicLib::OSGB::OriginLatitude
static double OriginLatitude()
Definition: dotnet/NETGeographicLib/OSGB.cpp:124
NETGeographicLib::OSGB::OriginLongitude
static double OriginLongitude()
Definition: dotnet/NETGeographicLib/OSGB.cpp:127
NETGeographicLib::OSGB::Forward
static void Forward(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/OSGB.cpp:19
GeographicLib::OSGB::OriginLongitude
static Math::real OriginLongitude()
Definition: OSGB.hpp:228
lon
static const double lon
Definition: testGeographicLib.cpp:34
GeographicLib::OSGB::MajorRadius
static Math::real MajorRadius()
Definition: OSGB.hpp:190
NETGeographicLib
Definition: Accumulator.h:13
NETGeographicLib::StringConvert::ManagedToUnmanaged
static std::string ManagedToUnmanaged(System::String^ s)
Definition: NETGeographicLib.cpp:20
lat
static const double lat
Definition: testGeographicLib.cpp:34
GeographicLib::OSGB::FalseEasting
static Math::real FalseEasting()
Definition: OSGB.hpp:238
NETGeographicLib::OSGB::FalseEasting
static double FalseEasting()
Definition: dotnet/NETGeographicLib/OSGB.cpp:134


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:12:25