2018-01-08 23:47:45 +01:00
|
|
|
#ifndef PCS_H
|
|
|
|
#define PCS_H
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QList>
|
2019-08-01 08:36:58 +02:00
|
|
|
#include "common/kv.h"
|
2018-01-20 20:13:56 +01:00
|
|
|
#include "gcs.h"
|
2018-01-20 23:51:39 +01:00
|
|
|
#include "linearunits.h"
|
2018-04-05 20:38:23 +02:00
|
|
|
#include "coordinatesystem.h"
|
2018-01-08 23:47:45 +01:00
|
|
|
#include "projection.h"
|
|
|
|
|
|
|
|
class PCS
|
|
|
|
{
|
|
|
|
public:
|
2021-06-17 21:58:25 +02:00
|
|
|
PCS() {}
|
|
|
|
PCS(const GCS &gcs, const Projection::Method &method,
|
2018-04-05 20:38:23 +02:00
|
|
|
const Projection::Setup &setup, const LinearUnits &units,
|
|
|
|
const CoordinateSystem &cs = CoordinateSystem())
|
|
|
|
: _gcs(gcs), _method(method), _setup(setup), _units(units), _cs(cs) {}
|
2021-06-17 21:58:25 +02:00
|
|
|
PCS(const GCS &gcs, int proj);
|
2018-01-20 20:13:56 +01:00
|
|
|
|
2021-06-17 21:58:25 +02:00
|
|
|
const GCS &gcs() const {return _gcs;}
|
2018-01-08 23:47:45 +01:00
|
|
|
const Projection::Method &method() const {return _method;}
|
|
|
|
const Projection::Setup &setup() const {return _setup;}
|
2018-01-20 23:51:39 +01:00
|
|
|
const LinearUnits &units() const {return _units;}
|
2018-04-05 20:38:23 +02:00
|
|
|
const CoordinateSystem &coordinateSystem() const {return _cs;}
|
2018-01-08 23:47:45 +01:00
|
|
|
|
2021-06-17 21:58:25 +02:00
|
|
|
bool isNull() const {
|
|
|
|
return (_gcs.isNull() && _units.isNull() && _method.isNull()
|
|
|
|
&& _setup.isNull() && _cs.isNull());
|
|
|
|
}
|
|
|
|
bool isValid() const {
|
2021-06-27 16:00:27 +02:00
|
|
|
// We do not check the CoordinateSystem here as it is not always defined
|
|
|
|
// and except of WMTS/WMS it is not needed.
|
|
|
|
return (_gcs.isValid() && _units.isValid() && _method.isValid());
|
2021-06-17 21:58:25 +02:00
|
|
|
}
|
2018-01-08 23:47:45 +01:00
|
|
|
|
2018-01-20 20:13:56 +01:00
|
|
|
static void loadList(const QString &path);
|
2021-07-01 08:54:48 +02:00
|
|
|
static PCS pcs(int id);
|
|
|
|
static PCS pcs(const GCS &gcs, int proj);
|
2019-08-01 08:36:58 +02:00
|
|
|
static QList<KV<int, QString> > list();
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
class Entry;
|
|
|
|
|
2019-05-14 23:01:24 +02:00
|
|
|
static QList<Entry> defaults();
|
2018-06-28 22:12:16 +02:00
|
|
|
|
2021-06-17 21:58:25 +02:00
|
|
|
GCS _gcs;
|
2018-01-08 23:47:45 +01:00
|
|
|
Projection::Method _method;
|
|
|
|
Projection::Setup _setup;
|
2018-01-20 23:51:39 +01:00
|
|
|
LinearUnits _units;
|
2018-04-05 20:38:23 +02:00
|
|
|
CoordinateSystem _cs;
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
static QList<Entry> _pcss;
|
|
|
|
};
|
|
|
|
|
2018-02-13 23:03:18 +01:00
|
|
|
#ifndef QT_NO_DEBUG
|
2018-01-08 23:47:45 +01:00
|
|
|
QDebug operator<<(QDebug dbg, const PCS &pcs);
|
2018-02-13 23:03:18 +01:00
|
|
|
#endif // QT_NO_DEBUG
|
2018-01-08 23:47:45 +01:00
|
|
|
|
|
|
|
#endif // PCS_H
|