2018-01-20 20:13:56 +01:00
|
|
|
#ifndef GCS_H
|
|
|
|
#define GCS_H
|
|
|
|
|
|
|
|
#include "datum.h"
|
|
|
|
#include "angularunits.h"
|
|
|
|
#include "primemeridian.h"
|
|
|
|
|
|
|
|
class GCS
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GCS() {}
|
|
|
|
GCS(const Datum &datum, const PrimeMeridian &primeMeridian,
|
|
|
|
const AngularUnits &angularUnits) : _datum(datum),
|
|
|
|
_primeMeridian(primeMeridian), _angularUnits(angularUnits) {}
|
|
|
|
|
|
|
|
const PrimeMeridian &primeMeridian() const {return _primeMeridian;}
|
|
|
|
const AngularUnits &angularUnits() const {return _angularUnits;}
|
|
|
|
const Datum &datum() const {return _datum;}
|
|
|
|
|
|
|
|
bool isNull() const {return _datum.isNull() && _angularUnits.isNull()
|
|
|
|
&& _primeMeridian.isNull();}
|
|
|
|
bool isValid() const {return _datum.isValid() && _angularUnits.isValid()
|
|
|
|
&& _primeMeridian.isValid();}
|
|
|
|
|
|
|
|
Coordinates toWGS84(const Coordinates &c) const;
|
|
|
|
Coordinates fromWGS84(const Coordinates &c) const;
|
|
|
|
|
|
|
|
static const GCS *gcs(int id);
|
|
|
|
static const GCS *gcs(int geodeticDatum, int primeMeridian,
|
|
|
|
int angularUnits);
|
|
|
|
static const GCS *gcs(const QString &name);
|
2018-06-28 22:12:16 +02:00
|
|
|
static const GCS &WGS84();
|
2018-01-20 20:13:56 +01:00
|
|
|
|
|
|
|
static void loadList(const QString &path);
|
|
|
|
|
|
|
|
private:
|
|
|
|
class Entry;
|
|
|
|
|
2018-06-28 22:12:16 +02:00
|
|
|
static QList<Entry> defaults();
|
2018-01-20 20:13:56 +01:00
|
|
|
|
|
|
|
Datum _datum;
|
|
|
|
PrimeMeridian _primeMeridian;
|
|
|
|
AngularUnits _angularUnits;
|
|
|
|
|
|
|
|
static QList<Entry> _gcss;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline bool operator==(const GCS &gcs1, const GCS &gcs2)
|
|
|
|
{return (gcs1.datum() == gcs2.datum()
|
|
|
|
&& gcs1.primeMeridian() == gcs2.primeMeridian()
|
|
|
|
&& gcs1.angularUnits() == gcs2.angularUnits());}
|
|
|
|
|
2018-02-13 23:03:18 +01:00
|
|
|
#ifndef QT_NO_DEBUG
|
2018-01-20 20:13:56 +01:00
|
|
|
QDebug operator<<(QDebug dbg, const GCS &gcs);
|
2018-02-13 23:03:18 +01:00
|
|
|
#endif // QT_NO_DEBUG
|
2018-01-20 20:13:56 +01:00
|
|
|
|
|
|
|
#endif // GCS_H
|