#pragma once

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

#include "PolygonCalculus.h"


namespace GeoUtilities {

    typedef QList<QVector3D> QVector3DList;
    typedef QList<QPointF>   QPointFList;
    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);
    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);
}

