dotnet/NETGeographicLib/MGRS.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
12 #include "GeographicLib/MGRS.hpp"
13 #include "MGRS.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 //*****************************************************************************
19 void MGRS::Forward(int zone, bool northp, double x, double y,
20  int prec,
21  [System::Runtime::InteropServices::Out] System::String^% mgrs)
22 {
23  try
24  {
25  std::string lmgrs;
26  GeographicLib::MGRS::Forward( zone, northp, x, y, prec, lmgrs );
27  mgrs = gcnew System::String( lmgrs.c_str() );
28  }
29  catch ( const std::exception& err )
30  {
31  throw gcnew GeographicErr( err.what() );
32  }
33 }
34 
35 //*****************************************************************************
36 void MGRS::Forward(int zone, bool northp, double x, double y, double lat,
37  int prec, System::String^% mgrs)
38 {
39  try
40  {
41  std::string lmgrs;
42  GeographicLib::MGRS::Forward( zone, northp, x, y, lat, prec, lmgrs );
43  mgrs = gcnew System::String( lmgrs.c_str() );
44  }
45  catch ( const std::exception& err )
46  {
47  throw gcnew GeographicErr( err.what() );
48  }
49 }
50 
51 //*****************************************************************************
52 void MGRS::Reverse(System::String^ mgrs,
53  [System::Runtime::InteropServices::Out] int% zone,
54  [System::Runtime::InteropServices::Out] bool% northp,
55  [System::Runtime::InteropServices::Out] double% x,
56  [System::Runtime::InteropServices::Out] double% y,
57  [System::Runtime::InteropServices::Out] int% prec,
58  bool centerp )
59 {
60  try
61  {
62  double lx, ly;
63  int lzone, lprec;
64  bool lnorthp;
66  lzone, lnorthp, lx, ly, lprec, centerp );
67  x = lx;
68  y = ly;
69  zone = lzone;
70  prec = lprec;
71  northp = lnorthp;
72  }
73  catch ( const std::exception& err )
74  {
75  throw gcnew GeographicErr( err.what() );
76  }
77 }
78 
79 //*****************************************************************************
81 
82 //*****************************************************************************
NETGeographicLib::MGRS::MajorRadius
static double MajorRadius()
Definition: dotnet/NETGeographicLib/MGRS.cpp:80
GeographicLib::UTMUPS::Flattening
static Math::real Flattening()
Definition: UTMUPS.hpp:414
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::MGRS::Forward
static void Forward(int zone, bool northp, real x, real y, int prec, std::string &mgrs)
Definition: src/MGRS.cpp:114
NETGeographicLib::MGRS::Forward
static void Forward(int zone, bool northp, double x, double y, int prec, [System::Runtime::InteropServices::Out] System::String^% mgrs)
Definition: dotnet/NETGeographicLib/MGRS.cpp:19
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
GeographicLib::UTMUPS::MajorRadius
static Math::real MajorRadius()
Definition: UTMUPS.hpp:405
stdafx.h
MGRS.hpp
Header for GeographicLib::MGRS class.
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
NETGeographicLib::MGRS::Flattening
static double Flattening()
Definition: dotnet/NETGeographicLib/MGRS.cpp:83
y
Scalar * y
Definition: level1_cplx_impl.h:124
NETGeographicLib::MGRS::Reverse
static void Reverse(System::String^ mgrs, [System::Runtime::InteropServices::Out] int% zone, [System::Runtime::InteropServices::Out] bool% northp, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] int% prec, bool centerp)
Definition: dotnet/NETGeographicLib/MGRS.cpp:52
GeographicLib::MGRS::Reverse
static void Reverse(const std::string &mgrs, int &zone, bool &northp, real &x, real &y, int &prec, bool centerp=true)
Definition: src/MGRS.cpp:149
MGRS.h
Header for NETGeographicLib::MGRS class.
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


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