2016-10-24 20:00:29 +02:00
|
|
|
#ifndef KMLPARSER_H
|
|
|
|
#define KMLPARSER_H
|
|
|
|
|
|
|
|
#include <QXmlStreamReader>
|
2016-10-25 22:50:11 +02:00
|
|
|
#include <QDateTime>
|
2016-10-24 20:00:29 +02:00
|
|
|
#include "parser.h"
|
|
|
|
|
|
|
|
class KMLParser : public Parser
|
|
|
|
{
|
|
|
|
public:
|
2019-01-31 01:46:53 +01:00
|
|
|
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
|
|
|
QList<Area> &areas, QVector<Waypoint> &waypoints);
|
2016-10-24 20:00:29 +02:00
|
|
|
QString errorString() const {return _reader.errorString();}
|
|
|
|
int errorLine() const {return _reader.lineNumber();}
|
|
|
|
|
|
|
|
private:
|
2019-01-31 01:46:53 +01:00
|
|
|
void kml(QList<TrackData> &tracks, QList<Area> &areas,
|
|
|
|
QVector<Waypoint> &waypoints);
|
|
|
|
void document(QList<TrackData> &tracks, QList<Area> &areas,
|
|
|
|
QVector<Waypoint> &waypoints);
|
|
|
|
void folder(QList<TrackData> &tracks, QList<Area> &areas,
|
|
|
|
QVector<Waypoint> &waypoints);
|
|
|
|
void placemark(QList<TrackData> &tracks, QList<Area> &areas,
|
|
|
|
QVector<Waypoint> &waypoints);
|
|
|
|
void multiGeometry(QList<TrackData> &tracks, QList<Area> &areas,
|
|
|
|
QVector<Waypoint> &waypoints, const QString &name, const QString &desc,
|
2019-03-05 22:52:14 +01:00
|
|
|
const QDateTime ×tamp);
|
2019-02-11 23:28:08 +01:00
|
|
|
void track(SegmentData &segment);
|
2017-10-11 22:41:01 +02:00
|
|
|
void multiTrack(TrackData &t);
|
2019-02-11 23:28:08 +01:00
|
|
|
void lineString(SegmentData &segment);
|
2019-01-31 01:46:53 +01:00
|
|
|
void linearRing(QVector<Coordinates> &coordinates);
|
|
|
|
void boundary(QVector<Coordinates> &coordinates);
|
|
|
|
void polygon(Area &area);
|
2016-10-27 22:33:35 +02:00
|
|
|
void point(Waypoint &waypoint);
|
|
|
|
bool pointCoordinates(Waypoint &waypoint);
|
2019-02-11 23:28:08 +01:00
|
|
|
bool lineCoordinates(SegmentData &segment);
|
2019-01-31 01:46:53 +01:00
|
|
|
bool polygonCoordinates(QVector<Coordinates> &points);
|
2016-10-28 19:12:40 +02:00
|
|
|
bool coord(Trackpoint &trackpoint);
|
2019-02-11 23:28:08 +01:00
|
|
|
void extendedData(SegmentData &segment, int start);
|
|
|
|
void schemaData(SegmentData &segment, int start);
|
|
|
|
void heartRate(SegmentData &segment, int start);
|
|
|
|
void cadence(SegmentData &segment, int start);
|
|
|
|
void speed(SegmentData &segment, int start);
|
|
|
|
void temperature(SegmentData &segment, int start);
|
2016-10-28 14:33:36 +02:00
|
|
|
QDateTime timeStamp();
|
2016-10-27 22:33:35 +02:00
|
|
|
qreal number();
|
|
|
|
QDateTime time();
|
2016-10-24 20:00:29 +02:00
|
|
|
|
|
|
|
QXmlStreamReader _reader;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KMLPARSER_H
|