NETGeographicLib
1.43
|
.NET wrapper for GeographicLib::TransverseMercator. More...
#include <NETGeographicLib/TransverseMercator.h>
Public Member Functions | |
TransverseMercator (double a, double f, double k0) | |
TransverseMercator () | |
~TransverseMercator () | |
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) |
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) |
void | Forward (double lon0, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y) |
void | Reverse (double lon0, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon) |
Properties | |
Inspector functions | |
double | MajorRadius [get] |
double | Flattening [get] |
double | CentralScale [get] |
.NET wrapper for GeographicLib::TransverseMercator.
This class allows .NET applications to access GeographicLib::TransverseMercator.
This uses Krüger's method which evaluates the projection and its inverse in terms of a series. See
Krüger's method has been extended from 4th to 6th order. The maximum error is 5 nm (5 nanometers), ground distance, for all positions within 35 degrees of the central meridian. The error in the convergence is 2 × 10−15" and the relative error in the scale is 6 − 10−12%%. See Sec. 4 of arXiv:1002.1417 for details. The speed penalty in going to 6th order is only about 1%. TransverseMercatorExact is an alternative implementation of the projection using exact formulas which yield accurate (to 8 nm) results over the entire ellipsoid.
The ellipsoid parameters and the central scale are set in the constructor. The central meridian (which is a trivial shift of the longitude) is specified as the lon0 argument of the TransverseMercator::Forward and TransverseMercator::Reverse functions. The latitude of origin is taken to be the equator. There is no provision in this class for specifying a false easting or false northing or a different latitude of origin. However these are can be simply included by the calling function. For example, the UTMUPS class applies the false easting and false northing for the UTM projections. A more complicated example is the British National Grid (EPSG:7405) which requires the use of a latitude of origin. This is implemented by the GeographicLib::OSGB class.
See GeographicLib::TransverseMercator.cpp for more information on the implementation.
See Transverse Mercator projection for a discussion of this projection.
C# Example:
Managed C++ Example:
Visual Basic Example:
INTERFACE DIFFERENCES:
A default constructor is provided that assumes WGS84 parameters and a UTM scale factor.
The MajorRadius, Flattening, and CentralScale functions are implemented as properties.
Definition at line 77 of file TransverseMercator.h.
NETGeographicLib::TransverseMercator::TransverseMercator | ( | double | a, |
double | f, | ||
double | k0 | ||
) |
Constructor for a ellipsoid with
[in] | a | equatorial radius (meters). |
[in] | f | flattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid. If f > 1, set flattening to 1/f. |
[in] | k0 | central scale factor. |
GeographicErr | if a, (1 − f ) a, or k0 is not positive. |
NETGeographicLib::TransverseMercator::TransverseMercator | ( | ) |
The default constructor assumes a WGS84 ellipsoid and a UTM scale factor.
Referenced by ~TransverseMercator().
|
inline |
The destructor calls the finalizer.
Definition at line 107 of file TransverseMercator.h.
References Forward(), Reverse(), and TransverseMercator().
void NETGeographicLib::TransverseMercator::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 | ||
) |
Forward projection, from geographic to transverse Mercator.
[in] | lon0 | central meridian of the projection (degrees). |
[in] | lat | latitude of point (degrees). |
[in] | lon | longitude of point (degrees). |
[out] | x | easting of point (meters). |
[out] | y | northing of point (meters). |
[out] | gamma | meridian convergence at point (degrees). |
[out] | k | scale of projection at point. |
No false easting or northing is added. lat should be in the range [−90°, 90°]; lon and lon0 should be in the range [−540°, 540°).
Referenced by ~TransverseMercator().
void NETGeographicLib::TransverseMercator::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 | ||
) |
Reverse projection, from transverse Mercator to geographic.
[in] | lon0 | central meridian of the projection (degrees). |
[in] | x | easting of point (meters). |
[in] | y | northing of point (meters). |
[out] | lat | latitude of point (degrees). |
[out] | lon | longitude of point (degrees). |
[out] | gamma | meridian convergence at point (degrees). |
[out] | k | scale of projection at point. |
No false easting or northing is added. lon0 should be in the range [−540°, 540°). The value of lon returned is in the range [−180°, 180°).
Referenced by ~TransverseMercator().
void NETGeographicLib::TransverseMercator::Forward | ( | double | lon0, |
double | lat, | ||
double | lon, | ||
[System::Runtime::InteropServices::Out] double% | x, | ||
[System::Runtime::InteropServices::Out] double% | y | ||
) |
TransverseMercator::Forward without returning the convergence and scale.
void NETGeographicLib::TransverseMercator::Reverse | ( | double | lon0, |
double | x, | ||
double | y, | ||
[System::Runtime::InteropServices::Out] double% | lat, | ||
[System::Runtime::InteropServices::Out] double% | lon | ||
) |
TransverseMercator::Reverse without returning the convergence and scale.
|
get |
Definition at line 173 of file TransverseMercator.h.
|
get |
Definition at line 179 of file TransverseMercator.h.
|
get |
Definition at line 185 of file TransverseMercator.h.