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
static void Forward(real lat, real lon, real &x, real &y, real &gamma, real &k)
Definition: OSGB.hpp:81
static const char *const letters_
Definition: OSGB.hpp:47
#define GEOGRAPHICLIB_EXPORT
Definition: Constants.hpp:91
float real
Definition: datatypes.h:10
Scalar * y
static const double lat
static Math::real Flattening()
Definition: OSGB.hpp:205
Math::real real
Definition: OSGB.hpp:46
static Math::real FalseEasting()
Definition: OSGB.hpp:238
static Math::real OriginLatitude()
Definition: OSGB.hpp:222
Transverse Mercator projection.
static const char *const digits_
Definition: OSGB.hpp:48
Header for GeographicLib::TransverseMercator class.
static Math::real CentralScale()
Definition: OSGB.hpp:214
static Math::real FalseNorthing()
Definition: OSGB.hpp:233
static Math::real OriginLongitude()
Definition: OSGB.hpp:228
static Math::real MajorRadius()
Definition: OSGB.hpp:190
Namespace for GeographicLib.
static void Reverse(real x, real y, real &lat, real &lon, real &gamma, real &k)
Definition: OSGB.hpp:102
Ordnance Survey grid system for Great Britain.
Definition: OSGB.hpp:44
Header for GeographicLib::Constants class.
static const double lon
static void Forward(real lat, real lon, real &x, real &y)
Definition: OSGB.hpp:112
static void Reverse(real x, real y, real &lat, real &lon)
Definition: OSGB.hpp:120
Jet< T, N > pow(const Jet< T, N > &f, double g)
Definition: jet.h:570
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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:59