2018-01-20 20:13:56 +01:00
|
|
|
#ifndef GCS_H
|
|
|
|
#define GCS_H
|
|
|
|
|
2019-08-01 08:36:58 +02:00
|
|
|
#include "common/kv.h"
|
2018-01-20 20:13:56 +01:00
|
|
|
#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) {}
|
|
|
|
|
2020-04-21 23:26:35 +02:00
|
|
|
bool operator==(const GCS &other) const
|
|
|
|
{
|
|
|
|
return (_datum == other._datum && _primeMeridian == other._primeMeridian
|
|
|
|
&& _angularUnits == other._angularUnits);
|
|
|
|
}
|
|
|
|
|
2018-01-20 20:13:56 +01:00
|
|
|
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;
|
|
|
|
|
2021-07-01 08:54:48 +02:00
|
|
|
static GCS gcs(int id);
|
|
|
|
static GCS gcs(int geodeticDatum, int primeMeridian, int angularUnits);
|
|
|
|
static 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);
|
2019-08-01 08:36:58 +02:00
|
|
|
static QList<KV<int, QString> > list();
|
2018-01-20 20:13:56 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
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
|