Ordnance Survey grid system for Great Britain. More...
#include <GeographicLib/OSGB.hpp>
Static Public Member Functions | |
static void | Forward (real lat, real lon, real &x, real &y, real &gamma, real &k) throw () |
static void | Reverse (real x, real y, real &lat, real &lon, real &gamma, real &k) throw () |
static void | Forward (real lat, real lon, real &x, real &y) throw () |
static void | Reverse (real x, real y, real &lat, real &lon) throw () |
static void | GridReference (real x, real y, int prec, std::string &gridref) |
static void | GridReference (const std::string &gridref, real &x, real &y, int &prec, bool centerp=true) |
Inspector functions | |
static Math::real | MajorRadius () throw () |
static Math::real | InverseFlattening () throw () |
static Math::real | CentralScale () throw () |
static Math::real | OriginLatitude () throw () |
static Math::real | OriginLongitude () throw () |
static Math::real | FalseNorthing () throw () |
static Math::real | FalseEasting () throw () |
Ordnance Survey grid system for Great Britain.
The class implements the coordinate system used by the Ordnance Survey for maps of Great Britain and conversions to the grid reference system.
See
WARNING: the latitudes and longitudes for the Ordnance Survey grid system do not use the WGS84 datum. Do not use the values returned by this class in the UTMUPS, MGRS, or Geoid classes without first converting the datum (and vice versa).
Definition at line 36 of file OSGB.hpp.
static void GeographicLib::OSGB::Forward | ( | real | lat, | |
real | lon, | |||
real & | x, | |||
real & | y, | |||
real & | gamma, | |||
real & | k | |||
) | throw () [inline, static] |
Forward projection, from geographic to OSGB coordinates.
[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. |
lat should be in the range [-90, 90]; lon and lon0 should be in the range [-180, 360].
Definition at line 83 of file OSGB.hpp.
References FalseEasting(), GeographicLib::TransverseMercator::Forward(), and OriginLongitude().
Referenced by Forward().
static void GeographicLib::OSGB::Reverse | ( | real | x, | |
real | y, | |||
real & | lat, | |||
real & | lon, | |||
real & | gamma, | |||
real & | k | |||
) | throw () [inline, static] |
Reverse projection, from OSGB coordinates to geographic.
[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. |
The value of lon returned is in the range [-180, 180).
Definition at line 103 of file OSGB.hpp.
References FalseEasting(), OriginLongitude(), and GeographicLib::TransverseMercator::Reverse().
Referenced by Reverse().
static void GeographicLib::OSGB::Forward | ( | real | lat, | |
real | lon, | |||
real & | x, | |||
real & | y | |||
) | throw () [inline, static] |
OSGB::Forward without returning the convergence and scale.
Definition at line 113 of file OSGB.hpp.
References Forward().
static void GeographicLib::OSGB::Reverse | ( | real | x, | |
real | y, | |||
real & | lat, | |||
real & | lon | |||
) | throw () [inline, static] |
OSGB::Reverse without returning the convergence and scale.
Definition at line 121 of file OSGB.hpp.
References Reverse().
void GeographicLib::OSGB::GridReference | ( | real | x, | |
real | y, | |||
int | prec, | |||
std::string & | gridref | |||
) | [static] |
Convert OSGB coordinates to a grid reference.
[in] | x | easting of point (meters). |
[in] | y | northing of point (meters). |
[in] | prec | precision relative to 100 km. |
[out] | gridref | National Grid reference. |
prec specifies the precision of the grid reference string as follows:
The easting must be in the range [-1000 km, 1500 km) and the northing must be in the range [-500 km, 2000 km). An exception is thrown if either the easting and northing is outside these bounds. These bounds are consistent with rules for the letter designations for the grid system.
void GeographicLib::OSGB::GridReference | ( | const std::string & | gridref, | |
real & | x, | |||
real & | y, | |||
int & | prec, | |||
bool | centerp = true | |||
) | [static] |
Convert OSGB coordinates to a grid reference.
[in] | gridref | National Grid reference. |
[out] | x | easting of point (meters). |
[out] | y | northing of point (meters). |
[out] | prec | precision relative to 100 km. |
[in] | centerp | if true (default), return center of the grid square, else return SW (lower left) corner. |
The grid reference must be of the form: two letters (not including I) followed by an even number of digits (up to 22).
static Math::real GeographicLib::OSGB::MajorRadius | ( | ) | throw () [inline, static] |
static Math::real GeographicLib::OSGB::InverseFlattening | ( | ) | throw () [inline, static] |
For the Airy 1830 ellipsoid, a = 20923713 ft and b = 20853810 ft; thus the inverse flattening = 20923713/(20923713 - 20853810) = 2324857/7767 = 299.32496459... (The Airy 1830 value is returned because the OSGB projection is based on this ellipsoid.)
static Math::real GeographicLib::OSGB::CentralScale | ( | ) | throw () [inline, static] |
static Math::real GeographicLib::OSGB::OriginLatitude | ( | ) | throw () [inline, static] |
static Math::real GeographicLib::OSGB::OriginLongitude | ( | ) | throw () [inline, static] |
static Math::real GeographicLib::OSGB::FalseNorthing | ( | ) | throw () [inline, static] |
static Math::real GeographicLib::OSGB::FalseEasting | ( | ) | throw () [inline, static] |