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 //*****************************************************************************
Header for NETGeographicLib::NETGeographicLib objects.
Scalar * y
static const double lat
static Math::real Flattening()
Definition: UTMUPS.hpp:414
Exception class for NETGeographicLib.
static Math::real MajorRadius()
Definition: UTMUPS.hpp:405
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)
Header for GeographicLib::MGRS class.
Header for NETGeographicLib::MGRS class.
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
static std::string ManagedToUnmanaged(System::String^ s)
static void Forward(int zone, bool northp, double x, double y, int prec, [System::Runtime::InteropServices::Out] System::String^% mgrs)
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
static void Forward(int zone, bool northp, real x, real y, int prec, std::string &mgrs)
Definition: src/MGRS.cpp:114


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:55