|
void | dwdsigma (real u, real snu, real cnu, real dnu, real v, real snv, real cnv, real dnv, real &du, real &dv) const |
|
void | dwdzeta (real u, real snu, real cnu, real dnu, real v, real snv, real cnv, real dnv, real &du, real &dv) const |
|
void | Scale (real tau, real lam, real snu, real cnu, real dnu, real snv, real cnv, real dnv, real &gamma, real &k) const |
|
void | sigma (real u, real snu, real cnu, real dnu, real v, real snv, real cnv, real dnv, real &xi, real &eta) const |
|
void | sigmainv (real xi, real eta, real &u, real &v) const |
|
bool | sigmainv0 (real xi, real eta, real &u, real &v) const |
|
void | zeta (real u, real snu, real cnu, real dnu, real v, real snv, real cnv, real dnv, real &taup, real &lam) const |
|
void | zetainv (real taup, real lam, real &u, real &v) const |
|
bool | zetainv0 (real psi, real lam, real &u, real &v) const |
|
An exact implementation of the transverse Mercator projection.
Implementation of the Transverse Mercator Projection given in
- L. P. Lee, Conformal Projections Based On Jacobian Elliptic Functions, Part V of Conformal Projections Based on Elliptic Functions, (B. V. Gutsell, Toronto, 1976), 128pp., ISBN: 0919870163 (also appeared as: Monograph 16, Suppl. No. 1 to Canadian Cartographer, Vol 13).
- C. F. F. Karney, Transverse Mercator with an accuracy of a few nanometers, J. Geodesy 85(8), 475–485 (Aug. 2011); preprint arXiv:1002.1417.
Lee gives the correct results for forward and reverse transformations subject to the branch cut rules (see the description of the extendp argument to the constructor). The maximum error is about 8 nm (8 nanometers), ground distance, for the forward and reverse transformations. The error in the convergence is 2 × 10−15", the relative error in the scale is 7 × 10−12%%. See Sec. 3 of arXiv:1002.1417 for details. The method is "exact" in the sense that the errors are close to the round-off limit and that no changes are needed in the algorithms for them to be used with reals of a higher precision. Thus the errors using long double (with a 64-bit fraction) are about 2000 times smaller than using double (with a 53-bit fraction).
This algorithm is about 4.5 times slower than the 6th-order Krüger method, TransverseMercator, taking about 11 us for a combined forward and reverse projection on a 2.66 GHz Intel machine (g++, version 4.3.0, -O3).
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 TransverseMercatorExact::Forward and TransverseMercatorExact::Reverse functions. The latitude of origin is taken to be the equator. See the documentation on TransverseMercator for how to include a false easting, false northing, or a latitude of origin.
See tm-grid.kmz, for an illustration of the transverse Mercator grid in Google Earth.
This class also returns the meridian convergence gamma and scale k. The meridian convergence is the bearing of grid north (the y axis) measured clockwise from true north.
See TransverseMercatorExact.cpp for more information on the implementation.
See transversemercator for a discussion of this projection.
Example of use:
#include <iostream>
#include <iomanip>
#include <exception>
try {
{
double lat = 40.3,
lon = -74.7;
cout <<
x <<
" " <<
y <<
"\n";
}
{
double x = 25e3,
y = 4461e3;
cout <<
lat <<
" " <<
lon <<
"\n";
}
}
catch (
const exception&
e) {
cerr <<
"Caught exception: " <<
e.what() <<
"\n";
return 1;
}
}
TransverseMercatorProj is a command-line utility providing access to the functionality of TransverseMercator and TransverseMercatorExact.
Definition at line 83 of file TransverseMercatorExact.hpp.
GeographicLib::TransverseMercatorExact::TransverseMercatorExact |
( |
real |
a, |
|
|
real |
f, |
|
|
real |
k0, |
|
|
bool |
extendp = false |
|
) |
| |
Constructor for a ellipsoid with
- Parameters
-
[in] | a | equatorial radius (meters). |
[in] | f | flattening of ellipsoid. |
[in] | k0 | central scale factor. |
[in] | extendp | use extended domain. |
- Exceptions
-
The transverse Mercator projection has a branch point singularity at lat = 0 and lon − lon0 = 90 (1 − e) or (for TransverseMercatorExact::UTM) x = 18381 km, y = 0m. The extendp argument governs where the branch cut is placed. With extendp = false, the "standard" convention is followed, namely the cut is placed along x > 18381 km, y = 0m. Forward can be called with any lat and lon then produces the transformation shown in Lee, Fig 46. Reverse analytically continues this in the ± x direction. As a consequence, Reverse may map multiple points to the same geographic location; for example, for TransverseMercatorExact::UTM, x = 22051449.037349 m, y = −7131237.022729 m and x = 29735142.378357 m, y = 4235043.607933 m both map to lat = −2°, lon = 88°.
With extendp = true, the branch cut is moved to the lower left quadrant. The various symmetries of the transverse Mercator projection can be used to explore the projection on any sheet. In this mode the domains of lat, lon, x, and y are restricted to
- the union of
- lat in [0, 90] and lon − lon0 in [0, 90]
- lat in (-90, 0] and lon − lon0 in [90 (1 − e), 90]
- the union of
- x/(k0 a) in [0, ∞) and y/(k0 a) in [0, E(e2)]
- x/(k0 a) in [K(1 − e2) − E(1 − e2), ∞) and y/(k0 a) in (−∞, 0]
See Sec. 5 of arXiv:1002.1417 for a full discussion of the treatment of the branch cut.
The method will work for all ellipsoids used in terrestrial geodesy. The method cannot be applied directly to the case of a sphere (f = 0) because some the constants characterizing this method diverge in that limit, and in practice, f should be larger than about numeric_limits<real>::epsilon(). However, TransverseMercator treats the sphere exactly.
Definition at line 53 of file src/TransverseMercatorExact.cpp.