dotnet/examples/ManagedCPP/example-GeoCoords.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  // Miscellaneous conversions
8  double lat = 33.3, lon = 44.4;
9  GeoCoords^ c = gcnew GeoCoords(lat, lon, -1);
10  Console::WriteLine(c->MGRSRepresentation(-3));
11  c->Reset("18TWN0050", true, false);
12  Console::WriteLine(c->DMSRepresentation(0, false, 0));
13  Console::WriteLine(String::Format("Latitude: {0} Longitude: {1}", c->Latitude, c->Longitude));
14  c->Reset("1d38'W 55d30'N", true, false);
15  Console::WriteLine(c->GeoRepresentation(0, false));
16  }
17  catch (GeographicErr^ e) {
18  Console::WriteLine(String::Format("Caught exception: {0}", e->Message));
19  return -1;
20  }
21  return 0;
22 }
static const double lat
Exception class for NETGeographicLib.
Definition: numpy.h:543
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
property double Latitude
Definition: GeoCoords.h:236
property double Longitude
Definition: GeoCoords.h:241
.NET wrapper for GeographicLib::GeoCoords.
Definition: GeoCoords.h:55
Array< double, 1, 3 > e(1./3., 0.5, 2.)
int main(array< System::String^>^)
System::String GeoRepresentation(int prec, bool longfirst)
static const double lon
void Reset(System::String^s, bool centerp, bool longfirst)
System::String DMSRepresentation(int prec, bool longfirst, char dmssep)


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