Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
GeographicLib::AlbersEqualArea Class Reference

Albers equal area conic projection. More...

#include <AlbersEqualArea.hpp>

Public Member Functions

 AlbersEqualArea (real a, real f, real stdlat, real k0)
 
 AlbersEqualArea (real a, real f, real stdlat1, real stdlat2, real k1)
 
 AlbersEqualArea (real a, real f, real sinlat1, real coslat1, real sinlat2, real coslat2, real k1)
 
void Forward (real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
 
void Forward (real lon0, real lat, real lon, real &x, real &y) const
 
void Reverse (real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
 
void Reverse (real lon0, real x, real y, real &lat, real &lon) const
 
void SetScale (real lat, real k=real(1))
 
Inspector functions
Math::real MajorRadius () const
 
Math::real Flattening () const
 
Math::real OriginLatitude () const
 
Math::real CentralScale () const
 

Static Public Member Functions

static const AlbersEqualAreaAzimuthalEqualAreaNorth ()
 
static const AlbersEqualAreaAzimuthalEqualAreaSouth ()
 
static const AlbersEqualAreaCylindricalEqualArea ()
 

Private Types

typedef Math::real real
 

Private Member Functions

real atanhee (real x) const
 
real Datanhee (real x, real y) const
 
real DDatanhee (real x, real y) const
 
void Init (real sphi1, real cphi1, real sphi2, real cphi2, real k1)
 
real tphif (real txi) const
 
real txif (real tphi) const
 

Static Private Member Functions

static real atanhxm1 (real x)
 
static real Dsn (real x, real y, real sx, real sy)
 
static real hyp (real x)
 

Private Attributes

real _a
 
real _e
 
real _e2
 
real _e2m
 
real _f
 
real _fm
 
real _k0
 
real _k2
 
real _lat0
 
real _m02
 
real _n0
 
real _nrho0
 
real _qx
 
real _qZ
 
real _scxi0
 
real _sign
 
real _sxi0
 
real _txi0
 
real eps_
 
real epsx2_
 
real epsx_
 
real tol0_
 
real tol_
 

Static Private Attributes

static const int numit0_ = 20
 
static const int numit_ = 5
 

Friends

class Ellipsoid
 

Detailed Description

Albers equal area conic projection.

Implementation taken from the report,

This is a implementation of the equations in Snyder except that divided differences will be [have been] used to transform the expressions into ones which may be evaluated accurately. [In this implementation, the projection correctly becomes the cylindrical equal area or the azimuthal equal area projection when the standard latitude is the equator or a pole.]

The ellipsoid parameters, the standard parallels, and the scale on the standard parallels are set in the constructor. Internally, the case with two standard parallels is converted into a single standard parallel, the latitude of minimum azimuthal scale, with an azimuthal scale specified on this parallel. This latitude is also used as the latitude of origin which is returned by AlbersEqualArea::OriginLatitude. The azimuthal scale on the latitude of origin is given by AlbersEqualArea::CentralScale. The case with two standard parallels at opposite poles is singular and is disallowed. The central meridian (which is a trivial shift of the longitude) is specified as the lon0 argument of the AlbersEqualArea::Forward and AlbersEqualArea::Reverse functions. AlbersEqualArea::Forward and AlbersEqualArea::Reverse also return the meridian convergence, γ, and azimuthal scale, k. A small square aligned with the cardinal directions is projected to a rectangle with dimensions k (in the E-W direction) and 1/k (in the N-S direction). The E-W sides of the rectangle are oriented γ degrees counter-clockwise from the x axis. There is no provision in this class for specifying a false easting or false northing or a different latitude of origin.

Example of use:

// Example of using the GeographicLib::AlbersEqualArea class
#include <iostream>
#include <exception>
using namespace std;
using namespace GeographicLib;
int main() {
try {
const double
lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels
k1 = 1, // scale
lon0 = -77 - 45/60.0; // Central meridian
// Set up basic projection
const AlbersEqualArea albers(a, f, lat1, lat2, k1);
{
// Sample conversion from geodetic to Albers Equal Area
double lat = 39.95, lon = -75.17; // Philadelphia
double x, y;
albers.Forward(lon0, lat, lon, x, y);
cout << x << " " << y << "\n";
}
{
// Sample conversion from Albers Equal Area grid to geodetic
double x = 220e3, y = -53e3;
double lat, lon;
albers.Reverse(lon0, x, y, lat, lon);
cout << lat << " " << lon << "\n";
}
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
}

ConicProj is a command-line utility providing access to the functionality of LambertConformalConic and AlbersEqualArea.

Definition at line 60 of file AlbersEqualArea.hpp.

Member Typedef Documentation

◆ real

Definition at line 62 of file AlbersEqualArea.hpp.

Constructor & Destructor Documentation

◆ AlbersEqualArea() [1/3]

GeographicLib::AlbersEqualArea::AlbersEqualArea ( real  a,
real  f,
real  stdlat,
real  k0 
)

Constructor with a single standard parallel.

Parameters
[in]aequatorial radius of ellipsoid (meters).
[in]fflattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid.
[in]stdlatstandard parallel (degrees), the circle of tangency.
[in]k0azimuthal scale on the standard parallel.
Exceptions
GeographicErrif a, (1 − f) a, or k0 is not positive.
GeographicErrif stdlat is not in [−90°, 90°].

Definition at line 21 of file src/AlbersEqualArea.cpp.

◆ AlbersEqualArea() [2/3]

GeographicLib::AlbersEqualArea::AlbersEqualArea ( real  a,
real  f,
real  stdlat1,
real  stdlat2,
real  k1 
)

Constructor with two standard parallels.

Parameters
[in]aequatorial radius of ellipsoid (meters).
[in]fflattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid.
[in]stdlat1first standard parallel (degrees).
[in]stdlat2second standard parallel (degrees).
[in]k1azimuthal scale on the standard parallels.
Exceptions
GeographicErrif a, (1 − f) a, or k1 is not positive.
GeographicErrif stdlat1 or stdlat2 is not in [−90°, 90°], or if stdlat1 and stdlat2 are opposite poles.

Definition at line 49 of file src/AlbersEqualArea.cpp.

◆ AlbersEqualArea() [3/3]

GeographicLib::AlbersEqualArea::AlbersEqualArea ( real  a,
real  f,
real  sinlat1,
real  coslat1,
real  sinlat2,
real  coslat2,
real  k1 
)

Constructor with two standard parallels specified by sines and cosines.

Parameters
[in]aequatorial radius of ellipsoid (meters).
[in]fflattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid.
[in]sinlat1sine of first standard parallel.
[in]coslat1cosine of first standard parallel.
[in]sinlat2sine of second standard parallel.
[in]coslat2cosine of second standard parallel.
[in]k1azimuthal scale on the standard parallels.
Exceptions
GeographicErrif a, (1 − f) a, or k1 is not positive.
GeographicErrif stdlat1 or stdlat2 is not in [−90°, 90°], or if stdlat1 and stdlat2 are opposite poles.

This allows parallels close to the poles to be specified accurately. This routine computes the latitude of origin and the azimuthal scale at this latitude. If dlat = abs(lat2lat1) ≤ 160°, then the error in the latitude of origin is less than 4.5 × 10−14d;.

Definition at line 81 of file src/AlbersEqualArea.cpp.

Member Function Documentation

◆ atanhee()

real GeographicLib::AlbersEqualArea::atanhee ( real  x) const
inlineprivate

Definition at line 73 of file AlbersEqualArea.hpp.

◆ atanhxm1()

Math::real GeographicLib::AlbersEqualArea::atanhxm1 ( real  x)
staticprivate

Definition at line 348 of file src/AlbersEqualArea.cpp.

◆ AzimuthalEqualAreaNorth()

const AlbersEqualArea & GeographicLib::AlbersEqualArea::AzimuthalEqualAreaNorth ( )
static

A global instantiation of AlbersEqualArea with the WGS84 ellipsoid, stdlat = 90°, and k0 = 1. This degenerates to the Lambert azimuthal equal area projection.

Definition at line 284 of file src/AlbersEqualArea.cpp.

◆ AzimuthalEqualAreaSouth()

const AlbersEqualArea & GeographicLib::AlbersEqualArea::AzimuthalEqualAreaSouth ( )
static

A global instantiation of AlbersEqualArea with the WGS84 ellipsoid, stdlat = −90°, and k0 = 1. This degenerates to the Lambert azimuthal equal area projection.

Definition at line 291 of file src/AlbersEqualArea.cpp.

◆ CentralScale()

Math::real GeographicLib::AlbersEqualArea::CentralScale ( ) const
inline
Returns
central scale for the projection. This is the azimuthal scale on the latitude of origin.

Definition at line 285 of file AlbersEqualArea.hpp.

◆ CylindricalEqualArea()

const AlbersEqualArea & GeographicLib::AlbersEqualArea::CylindricalEqualArea ( )
static

A global instantiation of AlbersEqualArea with the WGS84 ellipsoid, stdlat = 0, and k0 = 1. This degenerates to the cylindrical equal area projection.

Definition at line 277 of file src/AlbersEqualArea.cpp.

◆ Datanhee()

real GeographicLib::AlbersEqualArea::Datanhee ( real  x,
real  y 
) const
inlineprivate

Definition at line 109 of file AlbersEqualArea.hpp.

◆ DDatanhee()

Math::real GeographicLib::AlbersEqualArea::DDatanhee ( real  x,
real  y 
) const
private

Definition at line 366 of file src/AlbersEqualArea.cpp.

◆ Dsn()

static real GeographicLib::AlbersEqualArea::Dsn ( real  x,
real  y,
real  sx,
real  sy 
)
inlinestaticprivate

Definition at line 102 of file AlbersEqualArea.hpp.

◆ Flattening()

Math::real GeographicLib::AlbersEqualArea::Flattening ( ) const
inline
Returns
f the flattening of the ellipsoid. This is the value used in the constructor.

Definition at line 270 of file AlbersEqualArea.hpp.

◆ Forward() [1/2]

void GeographicLib::AlbersEqualArea::Forward ( real  lon0,
real  lat,
real  lon,
real x,
real y,
real gamma,
real k 
) const

Forward projection, from geographic to Lambert conformal conic.

Parameters
[in]lon0central meridian longitude (degrees).
[in]latlatitude of point (degrees).
[in]lonlongitude of point (degrees).
[out]xeasting of point (meters).
[out]ynorthing of point (meters).
[out]gammameridian convergence at point (degrees).
[out]kazimuthal scale of projection at point; the radial scale is the 1/k.

The latitude origin is given by AlbersEqualArea::LatitudeOrigin(). No false easting or northing is added and lat should be in the range [−90°, 90°]. The values of x and y returned for points which project to infinity (i.e., one or both of the poles) will be large but finite.

Definition at line 386 of file src/AlbersEqualArea.cpp.

◆ Forward() [2/2]

void GeographicLib::AlbersEqualArea::Forward ( real  lon0,
real  lat,
real  lon,
real x,
real y 
) const
inline

AlbersEqualArea::Forward without returning the convergence and scale.

Definition at line 241 of file AlbersEqualArea.hpp.

◆ hyp()

static real GeographicLib::AlbersEqualArea::hyp ( real  x)
inlinestaticprivate

Definition at line 69 of file AlbersEqualArea.hpp.

◆ Init()

void GeographicLib::AlbersEqualArea::Init ( real  sphi1,
real  cphi1,
real  sphi2,
real  cphi2,
real  k1 
)
private

Definition at line 119 of file src/AlbersEqualArea.cpp.

◆ MajorRadius()

Math::real GeographicLib::AlbersEqualArea::MajorRadius ( ) const
inline
Returns
a the equatorial radius of the ellipsoid (meters). This is the value used in the constructor.

Definition at line 264 of file AlbersEqualArea.hpp.

◆ OriginLatitude()

Math::real GeographicLib::AlbersEqualArea::OriginLatitude ( ) const
inline
Returns
latitude of the origin for the projection (degrees).

This is the latitude of minimum azimuthal scale and equals the stdlat in the 1-parallel constructor and lies between stdlat1 and stdlat2 in the 2-parallel constructors.

Definition at line 279 of file AlbersEqualArea.hpp.

◆ Reverse() [1/2]

void GeographicLib::AlbersEqualArea::Reverse ( real  lon0,
real  x,
real  y,
real lat,
real lon,
real gamma,
real k 
) const

Reverse projection, from Lambert conformal conic to geographic.

Parameters
[in]lon0central meridian longitude (degrees).
[in]xeasting of point (meters).
[in]ynorthing of point (meters).
[out]latlatitude of point (degrees).
[out]lonlongitude of point (degrees).
[out]gammameridian convergence at point (degrees).
[out]kazimuthal scale of projection at point; the radial scale is the 1/k.

The latitude origin is given by AlbersEqualArea::LatitudeOrigin(). No false easting or northing is added. The value of lon returned is in the range [−180°, 180°]. The value of lat returned is in the range [−90°, 90°]. If the input point is outside the legal projected space the nearest pole is returned.

Definition at line 411 of file src/AlbersEqualArea.cpp.

◆ Reverse() [2/2]

void GeographicLib::AlbersEqualArea::Reverse ( real  lon0,
real  x,
real  y,
real lat,
real lon 
) const
inline

AlbersEqualArea::Reverse without returning the convergence and scale.

Definition at line 251 of file AlbersEqualArea.hpp.

◆ SetScale()

void GeographicLib::AlbersEqualArea::SetScale ( real  lat,
real  k = real(1) 
)

Set the azimuthal scale for the projection.

Parameters
[in]lat(degrees).
[in]kazimuthal scale at latitude lat (default 1).
Exceptions
GeographicErrk is not positive.
GeographicErrif lat is not in (−90°, 90°).

This allows a "latitude of conformality" to be specified.

Definition at line 433 of file src/AlbersEqualArea.cpp.

◆ tphif()

Math::real GeographicLib::AlbersEqualArea::tphif ( real  txi) const
private

Definition at line 325 of file src/AlbersEqualArea.cpp.

◆ txif()

Math::real GeographicLib::AlbersEqualArea::txif ( real  tphi) const
private

Definition at line 298 of file src/AlbersEqualArea.cpp.

Friends And Related Function Documentation

◆ Ellipsoid

friend class Ellipsoid
friend

Definition at line 119 of file AlbersEqualArea.hpp.

Member Data Documentation

◆ _a

real GeographicLib::AlbersEqualArea::_a
private

Definition at line 64 of file AlbersEqualArea.hpp.

◆ _e

real GeographicLib::AlbersEqualArea::_e
private

Definition at line 64 of file AlbersEqualArea.hpp.

◆ _e2

real GeographicLib::AlbersEqualArea::_e2
private

Definition at line 64 of file AlbersEqualArea.hpp.

◆ _e2m

real GeographicLib::AlbersEqualArea::_e2m
private

Definition at line 64 of file AlbersEqualArea.hpp.

◆ _f

real GeographicLib::AlbersEqualArea::_f
private

Definition at line 64 of file AlbersEqualArea.hpp.

◆ _fm

real GeographicLib::AlbersEqualArea::_fm
private

Definition at line 64 of file AlbersEqualArea.hpp.

◆ _k0

real GeographicLib::AlbersEqualArea::_k0
private

Definition at line 65 of file AlbersEqualArea.hpp.

◆ _k2

real GeographicLib::AlbersEqualArea::_k2
private

Definition at line 66 of file AlbersEqualArea.hpp.

◆ _lat0

real GeographicLib::AlbersEqualArea::_lat0
private

Definition at line 65 of file AlbersEqualArea.hpp.

◆ _m02

real GeographicLib::AlbersEqualArea::_m02
private

Definition at line 66 of file AlbersEqualArea.hpp.

◆ _n0

real GeographicLib::AlbersEqualArea::_n0
private

Definition at line 66 of file AlbersEqualArea.hpp.

◆ _nrho0

real GeographicLib::AlbersEqualArea::_nrho0
private

Definition at line 66 of file AlbersEqualArea.hpp.

◆ _qx

real GeographicLib::AlbersEqualArea::_qx
private

Definition at line 64 of file AlbersEqualArea.hpp.

◆ _qZ

real GeographicLib::AlbersEqualArea::_qZ
private

Definition at line 64 of file AlbersEqualArea.hpp.

◆ _scxi0

real GeographicLib::AlbersEqualArea::_scxi0
private

Definition at line 66 of file AlbersEqualArea.hpp.

◆ _sign

real GeographicLib::AlbersEqualArea::_sign
private

Definition at line 65 of file AlbersEqualArea.hpp.

◆ _sxi0

real GeographicLib::AlbersEqualArea::_sxi0
private

Definition at line 66 of file AlbersEqualArea.hpp.

◆ _txi0

real GeographicLib::AlbersEqualArea::_txi0
private

Definition at line 66 of file AlbersEqualArea.hpp.

◆ eps_

real GeographicLib::AlbersEqualArea::eps_
private

Definition at line 63 of file AlbersEqualArea.hpp.

◆ epsx2_

real GeographicLib::AlbersEqualArea::epsx2_
private

Definition at line 63 of file AlbersEqualArea.hpp.

◆ epsx_

real GeographicLib::AlbersEqualArea::epsx_
private

Definition at line 63 of file AlbersEqualArea.hpp.

◆ numit0_

const int GeographicLib::AlbersEqualArea::numit0_ = 20
staticprivate

Definition at line 68 of file AlbersEqualArea.hpp.

◆ numit_

const int GeographicLib::AlbersEqualArea::numit_ = 5
staticprivate

Definition at line 67 of file AlbersEqualArea.hpp.

◆ tol0_

real GeographicLib::AlbersEqualArea::tol0_
private

Definition at line 63 of file AlbersEqualArea.hpp.

◆ tol_

real GeographicLib::AlbersEqualArea::tol_
private

Definition at line 63 of file AlbersEqualArea.hpp.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:12