2019-01-06 18:45:09 +01:00
|
|
|
#ifndef DEM_H
|
|
|
|
#define DEM_H
|
|
|
|
|
|
|
|
#include <QMap>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QDir>
|
|
|
|
|
|
|
|
class QDir;
|
|
|
|
class Coordinates;
|
|
|
|
|
|
|
|
class DEM
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DEM() {}
|
2019-01-07 22:07:03 +01:00
|
|
|
DEM(const QString &dir) : _dir(dir) {}
|
2019-01-06 18:45:09 +01:00
|
|
|
qreal elevation(const Coordinates &c);
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct Key {
|
|
|
|
int lon;
|
|
|
|
int lat;
|
|
|
|
|
|
|
|
Key(int lon, int lat) : lon(lon), lat(lat) {}
|
|
|
|
|
|
|
|
bool operator<(const Key &other) const
|
|
|
|
{
|
|
|
|
if (lon < other.lon)
|
|
|
|
return true;
|
|
|
|
else if (lon > other.lon)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return (lat < other.lat);
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
QString fileName(const Key &key) const;
|
|
|
|
|
2019-01-07 22:07:03 +01:00
|
|
|
QString _dir;
|
2019-01-06 18:45:09 +01:00
|
|
|
QMap<Key, QByteArray> _data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DEM_H
|