GeoUtilities.h 1.49 KB
Newer Older
1
#pragma once
2 3 4 5 6

#include <QPointF>
#include <QGeoCoordinate>
#include <QVector3D>
#include <QGeoCoordinate>
7
#include <QtMath>
8

9
#include "PolygonCalculus.h"
10 11


12 13
namespace GeoUtilities {

14 15
    typedef QList<QVector3D>        QVector3DList;
    typedef QList<QPointF>          QPointFList;
16
    typedef QVector<QPointF>        QPointFVector;
17
    typedef QList<QGeoCoordinate>   QGeoList;
18
    typedef QVector<QGeoCoordinate> QGeoVector;
19 20 21

    const double earthRadius = 6378137; // meter

22
    QGeoCoordinate  toGeo         (const QVector3D &point, const QGeoCoordinate &origin);
23
    QGeoVector      toGeo         (const QVector3DList &points, const QGeoCoordinate &origin);
24
    QGeoCoordinate  toGeo         (const QPointF &point, const QGeoCoordinate &origin);
25 26
    QGeoVector      toGeo         (const QPointFList &points, const QGeoCoordinate &origin);
    QGeoVector      toGeo         (const QPointFVector &points, const QGeoCoordinate &origin);
27 28
    QVector3D       toCartesian   (const QGeoCoordinate &coordinate, const QGeoCoordinate &origin);
    QVector3DList   toCartesian   (const QGeoList &coordinates, const QGeoCoordinate &origin);
29
    QVector3DList   toCartesian   (const QGeoVector &coordinates, const QGeoCoordinate &origin);
30 31
    QPointF         toCartesian2D (const QGeoCoordinate &point, const QGeoCoordinate &origin);
    QPointFList     toCartesian2D (const QGeoList &coordinates, const QGeoCoordinate &origin);
32
    QPointFList     toCartesian2D (const QGeoVector &coordinates, const QGeoCoordinate &origin);
33
}
34