OSGB.hpp
Go to the documentation of this file.
1 
10 #if !defined(GEOGRAPHICLIB_OSGB_HPP)
11 #define GEOGRAPHICLIB_OSGB_HPP 1
12 
15 
16 #if defined(_MSC_VER)
17 // Squelch warnings about dll vs string
18 # pragma warning (push)
19 # pragma warning (disable: 4251)
20 #endif
21 
22 namespace GeographicLib {
23 
45  private:
46  typedef Math::real real;
47  static const char* const letters_;
48  static const char* const digits_;
49  static const TransverseMercator& OSGBTM();
50  enum {
51  base_ = 10,
52  tile_ = 100000,
53  tilelevel_ = 5,
54  tilegrid_ = 5,
55  tileoffx_ = 2 * tilegrid_,
56  tileoffy_ = 1 * tilegrid_,
57  minx_ = - tileoffx_ * tile_,
58  miny_ = - tileoffy_ * tile_,
59  maxx_ = (tilegrid_*tilegrid_ - tileoffx_) * tile_,
60  maxy_ = (tilegrid_*tilegrid_ - tileoffy_) * tile_,
61  // Maximum precision is um
62  maxprec_ = 5 + 6,
63  };
64  static real computenorthoffset();
65  static void CheckCoords(real x, real y);
66  OSGB(); // Disable constructor
67  public:
68 
81  static void Forward(real lat, real lon,
82  real& x, real& y, real& gamma, real& k) {
83  OSGBTM().Forward(OriginLongitude(), lat, lon, x, y, gamma, k);
84  x += FalseEasting();
85  y += computenorthoffset();
86  }
87 
102  static void Reverse(real x, real y,
103  real& lat, real& lon, real& gamma, real& k) {
104  x -= FalseEasting();
105  y -= computenorthoffset();
106  OSGBTM().Reverse(OriginLongitude(), x, y, lat, lon, gamma, k);
107  }
108 
112  static void Forward(real lat, real lon, real& x, real& y) {
113  real gamma, k;
114  Forward(lat, lon, x, y, gamma, k);
115  }
116 
120  static void Reverse(real x, real y, real& lat, real& lon) {
121  real gamma, k;
122  Reverse(x, y, lat, lon, gamma, k);
123  }
124 
154  static void GridReference(real x, real y, int prec, std::string& gridref);
155 
173  static void GridReference(const std::string& gridref,
174  real& x, real& y, int& prec,
175  bool centerp = true);
176 
179 
191  // result is about 6377563.3960320664406 m
192  using std::pow;
193  return pow(real(10), real(48401603 - 100000000) / 100000000)
194  * real(20923713);
195  }
196 
206  { return real(20923713 - 20853810) / real(20923713); }
207 
215  using std::pow;
216  return pow(real(10), real(9998268 - 10000000) / 10000000);
217  }
218 
222  static Math::real OriginLatitude() { return real(49); }
223 
228  static Math::real OriginLongitude() { return real(-2); }
229 
233  static Math::real FalseNorthing() { return real(-100000); }
234 
238  static Math::real FalseEasting() { return real(400000); }
240 
241  };
242 
243 } // namespace GeographicLib
244 
245 #if defined(_MSC_VER)
246 # pragma warning (pop)
247 #endif
248 
249 #endif // GEOGRAPHICLIB_OSGB_HPP
Eigen::Forward
@ Forward
Definition: NumericalDiff.h:19
GeographicLib::OSGB::OriginLatitude
static Math::real OriginLatitude()
Definition: OSGB.hpp:222
GeographicLib
Namespace for GeographicLib.
Definition: JacobiConformal.hpp:15
GeographicLib::OSGB::FalseNorthing
static Math::real FalseNorthing()
Definition: OSGB.hpp:233
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
real
float real
Definition: datatypes.h:10
GeographicLib::OSGB::Forward
static void Forward(real lat, real lon, real &x, real &y, real &gamma, real &k)
Definition: OSGB.hpp:81
GEOGRAPHICLIB_EXPORT
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
GeographicLib::OSGB::Flattening
static Math::real Flattening()
Definition: OSGB.hpp:205
GeographicLib::Math::real
double real
Definition: Math.hpp:129
TransverseMercator.hpp
Header for GeographicLib::TransverseMercator class.
GeographicLib::OSGB::CentralScale
static Math::real CentralScale()
Definition: OSGB.hpp:214
GeographicLib::OSGB
Ordnance Survey grid system for Great Britain.
Definition: OSGB.hpp:44
GeographicLib::OSGB::Reverse
static void Reverse(real x, real y, real &lat, real &lon)
Definition: OSGB.hpp:120
ceres::pow
Jet< T, N > pow(const Jet< T, N > &f, double g)
Definition: jet.h:570
gamma
#define gamma
Definition: mconf.h:85
GeographicLib::OSGB::Reverse
static void Reverse(real x, real y, real &lat, real &lon, real &gamma, real &k)
Definition: OSGB.hpp:102
Constants.hpp
Header for GeographicLib::Constants class.
GeographicLib::OSGB::digits_
static const char *const digits_
Definition: OSGB.hpp:48
GeographicLib::OSGB::real
Math::real real
Definition: OSGB.hpp:46
y
Scalar * y
Definition: level1_cplx_impl.h:124
GeographicLib::OSGB::Forward
static void Forward(real lat, real lon, real &x, real &y)
Definition: OSGB.hpp:112
GeographicLib::OSGB::OriginLongitude
static Math::real OriginLongitude()
Definition: OSGB.hpp:228
lon
static const double lon
Definition: testGeographicLib.cpp:34
GeographicLib::OSGB::MajorRadius
static Math::real MajorRadius()
Definition: OSGB.hpp:190
GeographicLib::OSGB::letters_
static const char *const letters_
Definition: OSGB.hpp:47
real
Definition: main.h:100
GeographicLib::TransverseMercator
Transverse Mercator projection.
Definition: TransverseMercator.hpp:93
lat
static const double lat
Definition: testGeographicLib.cpp:34
GeographicLib::OSGB::FalseEasting
static Math::real FalseEasting()
Definition: OSGB.hpp:238


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:12:25