Skip to content
GeoUtilities.h 1.25 KiB
Newer Older

#include <QPointF>
#include <QGeoCoordinate>
#include <QVector3D>
#include <QGeoCoordinate>
#include "PolygonCalculus.h"
    typedef QList<QVector3D>        QVector3DList;
    typedef QList<QPointF>          QPointFList;
    typedef QVector<QPointF>          QPointFVector;
    typedef QList<QGeoCoordinate>   QGeoList;

    const double earthRadius = 6378137; // meter

    QGeoCoordinate  toGeo         (const QVector3D &point, const QGeoCoordinate &origin);
    QGeoList        toGeo         (const QVector3DList &points, const QGeoCoordinate &origin);
    QGeoCoordinate  toGeo         (const QPointF &point, const QGeoCoordinate &origin);
    QGeoList        toGeo         (const QPointFList &points, const QGeoCoordinate &origin);
    QGeoList        toGeo         (const QPointFVector &points, const QGeoCoordinate &origin);
    QVector3D       toCartesian   (const QGeoCoordinate &coordinate, const QGeoCoordinate &origin);
    QVector3DList   toCartesian   (const QGeoList &coordinates, const QGeoCoordinate &origin);
    QPointF         toCartesian2D (const QGeoCoordinate &point, const QGeoCoordinate &origin);
    QPointFList     toCartesian2D (const QGeoList &coordinates, const QGeoCoordinate &origin);