|
static void | Forward (real lat, real lon, real &x, real &y, real &gamma, real &k) |
|
static void | Reverse (real x, real y, real &lat, real &lon, real &gamma, real &k) |
|
static void | Forward (real lat, real lon, real &x, real &y) |
|
static void | Reverse (real x, real y, real &lat, real &lon) |
|
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) |
|
|
static Math::real | MajorRadius () |
|
static Math::real | Flattening () |
|
static Math::real | CentralScale () |
|
static Math::real | OriginLatitude () |
|
static Math::real | OriginLongitude () |
|
static Math::real | FalseNorthing () |
|
static Math::real | FalseEasting () |
|
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).
Example of use:
#include <iostream>
#include <iomanip>
#include <exception>
#include <string>
try {
{
double
double x, y;
string gridref;
cout << fixed << setprecision(3)
<< x << " " << y << " " << gridref << "\n";
}
{
string gridref = "TG5113";
double x, y;
int prec;
double lat, lon;
cout << fixed << setprecision(8)
<< prec << " " << lat << " " << lon << "\n";
}
}
catch (const exception& e) {
cerr << "Caught exception: " << e.what() << "\n";
return 1;
}
return 0;
}
Definition at line 44 of file OSGB.hpp.
static void GeographicLib::OSGB::Forward |
( |
real |
lat, |
|
|
real |
lon, |
|
|
real & |
x, |
|
|
real & |
y, |
|
|
real & |
gamma, |
|
|
real & |
k |
|
) |
| |
|
inlinestatic |
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 should be in the range [−540°, 540°).
Definition at line 84 of file OSGB.hpp.
References GeographicLib::TransverseMercator::Forward().
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. |
- Exceptions
-
GeographicErr | if prec, x, or y is outside its allowed range. |
std::bad_alloc | if the memory for gridref can't be allocatied. |
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), 1μm
The easting must be in the range [−1000 km, 1500 km) and the northing must be in the range [−500 km, 2000 km). These bounds are consistent with rules for the letter designations for the grid system.
Definition at line 39 of file OSGB.cpp.
References GeographicLib::Utility::str().