Public Member Functions | Static Public Attributes
GeographicLib::TransverseMercatorExact Class Reference

An exact implementation of the Transverse Mercator Projection. More...

#include <GeographicLib/TransverseMercatorExact.hpp>

List of all members.

Public Member Functions

 TransverseMercatorExact (double a, double invf, double k0, bool extendp=false) throw ()
void Forward (double lon0, double lat, double lon, double &x, double &y, double &gamma, double &k) const throw ()
void Reverse (double lon0, double x, double y, double &lat, double &lon, double &gamma, double &k) const throw ()

Static Public Attributes

static const
TransverseMercatorExact 
UTM

Detailed Description

An exact implementation of the Transverse Mercator Projection.

Implementation of the Transverse Mercator Projection given in

This method 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 (ground distance) for the forward and reverse transformations. The error in the convergence is 2e-15", the relative error in the scale is 7e-12%%. (See \ref tmerrors for the weasel words.) 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, GeographicLib::TransverseMercator, taking about 11 us for a combined forward and reverse projection on a 2.6 GHz Intel machine (g++, version 4.3.0, -O3).

See TransverseMercatorExact.cpp for more information on the implementation.

See Transverse Mercator Projection for a discussion of this projection.


Constructor & Destructor Documentation

GeographicLib::TransverseMercatorExact::TransverseMercatorExact ( double  a,
double  invf,
double  k0,
bool  extendp = false 
) throw ()

Constructor for a ellipsoid radius a (meters), inverse flattening invf, and central scale factor k0. 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 deg, lon = 88 deg.

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, inf) and y/(k0 a) in [0, E(e^2)]
    • x/(k0 a) in [K(1 - e^2) - E(1 - e^2), inf) and y/(k0 a) in (-inf, 0]

See Properties far from the central meridian for a full discussion of the treatment of the branch cut.

The method will work for all ellipsoids used in terrestial geodesy. The method cannot be applied directly to the case of a sphere (invf = inf) because some the constants characterizing this method diverge in that limit. However, GeographicLib::TransverseMercator treats the sphere exactly.

Definition at line 63 of file TransverseMercatorExact.cpp.


Member Function Documentation

void GeographicLib::TransverseMercatorExact::Forward ( double  lon0,
double  lat,
double  lon,
double &  x,
double &  y,
double &  gamma,
double &  k 
) const throw ()

Convert from latitude lat (degrees) and longitude lon (degrees) to transverse Mercator easting x (meters) and northing y (meters). The central meridian of the transformation is lon0 (degrees). Also return the meridian convergence gamma (degrees) and the scale k. No false easting or northing is added. lat should be in the range [-90, 90]; lon and lon0 should be in the range [-180, 360].

Definition at line 386 of file TransverseMercatorExact.cpp.

References GeographicLib::Constants::degree().

Referenced by main().

void GeographicLib::TransverseMercatorExact::Reverse ( double  lon0,
double  x,
double  y,
double &  lat,
double &  lon,
double &  gamma,
double &  k 
) const throw ()

Convert from transverse Mercator easting x (meters) and northing y (meters) to latitude lat (degrees) and longitude lon (degrees) . The central meridian of the transformation is lon0 (degrees). Also return the meridian convergence gamma (degrees) and the scale k. No false easting or northing is added. The value of lon returned is in the range [-180, 180).

Definition at line 444 of file TransverseMercatorExact.cpp.

References GeographicLib::Constants::degree(), and GeographicLib::Constants::pi().

Referenced by main().


Member Data Documentation

A global instantiation of TransverseMercatorExact with the WGS84 ellipsoid and the UTM scale factor. However, unlike UTM, no false easting or northing is added.

Definition at line 189 of file TransverseMercatorExact.hpp.


The documentation for this class was generated from the following files: