2019-01-06 18:45:09 +01:00
|
|
|
#ifndef DEM_H
|
|
|
|
#define DEM_H
|
|
|
|
|
2019-01-17 00:47:44 +01:00
|
|
|
#include <QString>
|
2019-01-06 18:45:09 +01:00
|
|
|
#include <QMap>
|
|
|
|
#include <QByteArray>
|
|
|
|
|
2019-01-17 00:47:44 +01:00
|
|
|
class QString;
|
2019-01-06 18:45:09 +01:00
|
|
|
class Coordinates;
|
|
|
|
|
|
|
|
class DEM
|
|
|
|
{
|
|
|
|
public:
|
2019-01-17 00:47:44 +01:00
|
|
|
static void setDir(const QString &path);
|
|
|
|
static qreal elevation(const Coordinates &c);
|
2019-01-06 18:45:09 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-01-17 00:47:44 +01:00
|
|
|
static QString fileName(const Key &key);
|
2019-01-06 18:45:09 +01:00
|
|
|
|
2019-01-17 00:47:44 +01:00
|
|
|
static QString _dir;
|
|
|
|
static QMap<Key, QByteArray> _data;
|
2019-01-06 18:45:09 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DEM_H
|