Static Public Member Functions

GeographicLib::OSGB Class Reference

Ordnance Survey grid system for Great Britain. More...

#include <GeographicLib/OSGB.hpp>

List of all members.

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 ()

Detailed Description

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.


Member Function Documentation

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.

Parameters:
[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.

Parameters:
[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.

Parameters:
[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:

  • prec = 0 (min), 100km
  • prec = 1, 10km
  • prec = 2, 1km
  • prec = 3, 100m
  • prec = 4, 10m
  • prec = 5, 1m
  • prec = 6, 0.1m
  • prec = 11 (max), 1um

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.

Definition at line 35 of file OSGB.cpp.

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.

Parameters:
[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).

Definition at line 82 of file OSGB.cpp.

static Math::real GeographicLib::OSGB::MajorRadius (  )  throw () [inline, static]
Returns:
a the equatorial radius of the Airy 1830 ellipsoid (meters).

This is 20923713 ft converted to meters using the rule 1 ft = 10^(9.48401603-10) m. (The Airy 1830 value is returned because the OSGB projection is based on this ellipsoid.)

Definition at line 179 of file OSGB.hpp.

static Math::real GeographicLib::OSGB::InverseFlattening (  )  throw () [inline, static]
Returns:
r the inverse flattening of the Airy 1830 ellipsoid.

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.)

Definition at line 190 of file OSGB.hpp.

static Math::real GeographicLib::OSGB::CentralScale (  )  throw () [inline, static]
Returns:
k0 central scale for the OSGB projection (0.9996012717).

Definition at line 196 of file OSGB.hpp.

static Math::real GeographicLib::OSGB::OriginLatitude (  )  throw () [inline, static]
Returns:
latitude of the origin for the OSGB projection (49 degrees).

Definition at line 202 of file OSGB.hpp.

static Math::real GeographicLib::OSGB::OriginLongitude (  )  throw () [inline, static]
Returns:
longitude of the origin for the OSGB projection (-2 degrees).

Definition at line 207 of file OSGB.hpp.

Referenced by Forward(), and Reverse().

static Math::real GeographicLib::OSGB::FalseNorthing (  )  throw () [inline, static]
Returns:
false northing the OSGB projection (-100000 meters).

Definition at line 212 of file OSGB.hpp.

static Math::real GeographicLib::OSGB::FalseEasting (  )  throw () [inline, static]
Returns:
false easting the OSGB projection (400000 meters).

Definition at line 217 of file OSGB.hpp.

Referenced by Forward(), and Reverse().


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