dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
pureprojection.h
Go to the documentation of this file.
1 
13 /*
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, see <http://www.gnu.org/licenses/>
26 */
27 #ifndef PUREPROJECTION_H
28 #define PUREPROJECTION_H
29 
30 #include "../core/size.h"
31 #include "../core/point.h"
32 #include "../internals/pointlatlng.h"
33 #include "pointlatlng.h"
34 #include "cmath"
35 #include "rectlatlng.h"
36 #include <QDebug>
37 
38 using namespace core;
39 
40 namespace internals
41 {
42 
44 {
45 
46 
47 public:
48  virtual Size TileSize()const=0;
49 
50  virtual double Axis()const=0;
51 
52  virtual double Flattening()const=0;
53 
54  virtual core::Point FromLatLngToPixel(double lat, double lng, int const& zoom)=0;
55 
56  virtual PointLatLng FromPixelToLatLng(const qint64 &x,const qint64 &y,const int &zoom)=0;
57 
58  virtual QString Type(){return "PureProjection";}
59  core::Point FromLatLngToPixel(const PointLatLng &p,const int &zoom);
60 
61  PointLatLng FromPixelToLatLng(const Point &p,const int &zoom);
62  virtual core::Point FromPixelToTileXY(const core::Point &p);
63  virtual core::Point FromTileXYToPixel(const core::Point &p);
64  virtual Size GetTileMatrixMinXY(const int &zoom)=0;
65  virtual Size GetTileMatrixMaxXY(const int &zoom)=0;
66  virtual Size GetTileMatrixSizeXY(const int &zoom);
67  int GetTileMatrixItemCount(const int &zoom);
68  virtual Size GetTileMatrixSizePixel(const int &zoom);
69  QList<core::Point> GetAreaTileList(const RectLatLng &rect,const int &zoom,const int &padding);
70  virtual double GetGroundResolution(const int &zoom,const double &latitude);
71 
72  void FromGeodeticToCartesian(double Lat,double Lng,double Height, double &X, double &Y, double &Z);
73  void FromCartesianTGeodetic(const double &X,const double &Y,const double &Z, double &Lat, double &Lng);
74  static double DistanceBetweenLatLng(PointLatLng const& p1,PointLatLng const& p2);
75  static double DistanceBetweenLatLngAlt(PointLatLng const& p1, double const& alt1, PointLatLng const& p2, double const& alt2);
76 
77  PointLatLng translate(PointLatLng p1, double distance, double bearing);
78  double courseBetweenLatLng(const PointLatLng &p1, const PointLatLng &p2);
79  void offSetFromLatLngs(PointLatLng p1, PointLatLng p2, double &dX, double &dY);
80  double bound(double const& n, double const& minValue, double const& maxValue)const;
81 protected:
82 
83  static const double TWO_PI;
84  static const double EPSLoN;
85  static const double MAX_VAL;
86  static const double MAXLONG;
87  static const double DBLLONG;
88 
89  static double Sign(const double &x);
90 
91  static double AdjustLongitude(double x);
92  static void SinCos(const double &val, double &sin, double &cos);
93  static double e0fn(const double &x);
94  static double e1fn(const double &x);
95  static double e2fn(const double &x);
96  static double e3fn(const double &x);
97  static double mlfn(const double &e0,const double &e1,const double &e2,const double &e3,const double &phi);
98  static qlonglong GetUTMzone(const double &lon);
99 private:
100  double myfmod(double x, double y);
101 };
102 }
103 
104 
105 #endif // PUREPROJECTION_H
virtual QString Type()
static const double TWO_PI
Lat
Definition: OPPlots.m:110
static const double EPSLoN
Eccentricity n
Definition: OPPlots.m:137
static const double MAX_VAL
static const double MAXLONG
x
Definition: OPPlots.m:100
static const double DBLLONG
y
Definition: OPPlots.m:101