5 #include "common/coordinates.h"
7 #include "linearunits.h"
8 #include "coordinatesystem.h"
19 Setup() : _latitudeOrigin(NAN
), _longitudeOrigin(NAN
), _scale(NAN
),
20 _falseEasting(NAN
), _falseNorthing(NAN
), _standardParallel1(NAN
),
21 _standardParallel2(NAN
) {}
22 Setup(double latitudeOrigin
, double longitudeOrigin
, double scale
,
23 double falseEasting
, double falseNorthing
, double standardParallel1
,
24 double standardParallel2
) : _latitudeOrigin(latitudeOrigin
),
25 _longitudeOrigin(longitudeOrigin
), _scale(scale
),
26 _falseEasting(falseEasting
), _falseNorthing(falseNorthing
),
27 _standardParallel1(standardParallel1
),
28 _standardParallel2(standardParallel2
) {}
30 double latitudeOrigin() const {return _latitudeOrigin
;}
31 double longitudeOrigin() const {return _longitudeOrigin
;}
32 double scale() const {return _scale
;}
33 double falseEasting() const {return _falseEasting
;}
34 double falseNorthing() const {return _falseNorthing
;}
35 double standardParallel1() const {return _standardParallel1
;}
36 double standardParallel2() const {return _standardParallel2
;}
38 void setLatitudeOrigin(double val
) {_latitudeOrigin
= val
;}
39 void setLongitudeOrigin(double val
) {_longitudeOrigin
= val
;}
40 void setScale(double val
) {_scale
= val
;}
41 void setFalseEasting(double val
) {_falseEasting
= val
;}
42 void setFalseNorthing(double val
) {_falseNorthing
= val
;}
43 void setStandardParallel1(double val
) {_standardParallel1
= val
;}
44 void setStandardParallel2(double val
) {_standardParallel2
= val
;}
46 bool isNull() const {return std::isnan(_latitudeOrigin
)
47 && std::isnan(_longitudeOrigin
) && std::isnan(_scale
)
48 && std::isnan(_falseEasting
) && std::isnan(_falseNorthing
)
49 && std::isnan(_standardParallel1
) && std::isnan(_standardParallel2
);}
52 double _latitudeOrigin
;
53 double _longitudeOrigin
;
56 double _falseNorthing
;
57 double _standardParallel1
;
58 double _standardParallel2
;
66 int id() const {return _id
;}
67 bool isNull() const {return (_id
== 0);}
68 bool isValid() const {return !isNull();}
73 Projection() : _ct(0), _geographic(false) {}
74 Projection(const Projection
&p
);
75 Projection(const PCS
&pcs
);
76 Projection(const GCS
&gcs
, const CoordinateSystem
&cs
77 = CoordinateSystem(CoordinateSystem::YX
));
80 Projection
&operator=(const Projection
&p
);
81 bool operator==(const Projection
&p
) const;
85 return (_gcs
.isNull() && _ct
== 0 && _units
.isNull() && _cs
.isNull());
89 // We do not check the CoordinateSystem here as it is not always defined
90 // and except of WMTS/WMS it is not needed.
91 return (_gcs
.isValid() && _ct
!= 0 && _units
.isValid());
93 bool isGeographic() const {return _geographic
;}
95 PointD
ll2xy(const Coordinates
&c
) const;
96 Coordinates
xy2ll(const PointD
&p
) const;
98 const LinearUnits
&units() const {return _units
;}
99 const CoordinateSystem
&coordinateSystem() const {return _cs
;}
105 CoordinateSystem _cs
;
110 QDebug
operator<<(QDebug dbg
, const Projection::Setup
&setup
);
111 QDebug
operator<<(QDebug dbg
, const Projection::Method
&method
);
112 #endif // QT_NO_DEBUG
114 #endif // PROJECTION_H