ElevationMapProvider.h 1.5 KB
Newer Older
1 2 3
#pragma once

#include "MapProvider.h"
Pierre TILAK's avatar
Pierre TILAK committed
4
#include <cmath>
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

#include <QByteArray>
#include <QMutex>
#include <QNetworkProxy>
#include <QNetworkReply>
#include <QPoint>
#include <QString>

const quint32 AVERAGE_AIRMAP_ELEV_SIZE = 2786;
//-----------------------------------------------------------------------------
const double srtm1TileSize = 0.01;

class ElevationProvider : public MapProvider {
    Q_OBJECT
  public:
    ElevationProvider(QString imageFormat, quint32 averageSize,
                      QGeoMapType::MapStyle mapType, QObject* parent);

    ~ElevationProvider();

25
	bool _isElevationProvider(){return true;}
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42

  protected:
    // Define the url to Request
    virtual QString _getURL(int x, int y, int zoom,
                            QNetworkAccessManager* networkManager) = 0;
};

// -----------------------------------------------------------
// Airmap Elevation

class AirmapElevationProvider : public ElevationProvider {
    Q_OBJECT
  public:
    AirmapElevationProvider(QObject* parent)
        : ElevationProvider(QString("bin"), AVERAGE_AIRMAP_ELEV_SIZE,
                            QGeoMapType::StreetMap, parent) {}

43 44
    int long2tileX(double lon, int z);
    int lat2tileY(double lat, int z);
45 46 47
    QGCTileSet getTileCount(int zoom, double topleftLon,
                                     double topleftLat, double bottomRightLon,
                                     double bottomRightLat);
48 49


50 51 52 53 54
  protected:
    QString _getURL(int x, int y, int zoom,
                    QNetworkAccessManager* networkManager);
};