dotnet/examples/ManagedCPP/example-MGRS.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  // See also example-GeoCoords.cpp
8  {
9  // Sample forward calculation
10  double lat = 33.3, lon = 44.4; // Baghdad
11  int zone;
12  bool northp;
13  double x, y;
14  UTMUPS::Forward(lat, lon, zone, northp, x, y, -1, true);
15  String^ mgrs;
16  MGRS::Forward(zone, northp, x, y, lat, 5, mgrs);
17  Console::WriteLine(mgrs);
18  }
19  {
20  // Sample reverse calculation
21  String^ mgrs = "38SMB4488";
22  int zone, prec;
23  bool northp;
24  double x, y;
25  MGRS::Reverse(mgrs, zone, northp, x, y, prec, true);
26  double lat, lon;
27  UTMUPS::Reverse(zone, northp, x, y, lat, lon, true);
28  Console::WriteLine(String::Format("Latitude: {0} Longitude: {1}", lat, lon));
29  }
30  }
31  catch (GeographicErr^ e) {
32  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
33  return -1;
34  }
35  return 0;
36 }
Scalar * y
static const double lat
Exception class for NETGeographicLib.
Definition: numpy.h:543
Array< double, 1, 3 > e(1./3., 0.5, 2.)
int main(array< System::String^>^)
static const double lon
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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:02