dotnet/examples/ManagedCPP/example-AlbersEqualArea.cpp
Go to the documentation of this file.
1 using namespace System;
2 using namespace NETGeographicLib;
3 
5 {
6  try {
7  const double
8  lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels
9  k1 = 1, // scale
10  lon0 = -77 - 45/60.0; // Central meridian
11  // Set up basic projection
12  AlbersEqualArea^ albers = gcnew AlbersEqualArea( Constants::WGS84::MajorRadius,
13  Constants::WGS84::Flattening,
14  lat1, lat2, k1);
15  {
16  // Sample conversion from geodetic to Albers Equal Area
17  double lat = 39.95, lon = -75.17; // Philadelphia
18  double x, y;
19  albers->Forward(lon0, lat, lon, x, y);
20  Console::WriteLine( String::Format("X: {0} Y: {1}", x, y ) );
21  }
22  {
23  // Sample conversion from Albers Equal Area grid to geodetic
24  double x = 220e3, y = -53e3;
25  double lat, lon;
26  albers->Reverse(lon0, x, y, lat, lon);
27  Console::WriteLine( String::Format("Latitude: {0} Longitude: {1}", lat, lon ) );
28  }
29  }
30  catch (GeographicErr^ e) {
31  Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) );
32  return -1;
33  }
34  return 0;
35 }
Scalar * y
int main(array< System::String^>^)
static const double lat
Exception class for NETGeographicLib.
Definition: numpy.h:543
void Forward(double lon0, 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)
.NET Wrapper for GeographicLib::AlbersEqualArea.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
const double lon0
void Reverse(double lon0, 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)
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