mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-04-19 19:59:11 +02:00
Compare commits
9 Commits
f5f27c0212
...
5d1ba90f09
Author | SHA1 | Date | |
---|---|---|---|
5d1ba90f09 | |||
60fd7fb7c3 | |||
7249c85a02 | |||
099ce0ad6c | |||
b1aa32d23b | |||
1f31a5d6c5 | |||
044770bc84 | |||
c5f51e935e | |||
17ad10ba23 |
@ -117,6 +117,7 @@ HEADERS += src/common/config.h \
|
||||
src/data/gpsdumpparser.h \
|
||||
src/data/style.h \
|
||||
src/data/twonavparser.h \
|
||||
src/data/txtparser.h \
|
||||
src/map/IMG/light.h \
|
||||
src/map/downloader.h \
|
||||
src/map/demloader.h \
|
||||
@ -343,6 +344,7 @@ SOURCES += src/main.cpp \
|
||||
src/GUI/pngexportdialog.cpp \
|
||||
src/GUI/projectioncombobox.cpp \
|
||||
src/GUI/passwordedit.cpp \
|
||||
src/data/txtparser.cpp \
|
||||
src/map/downloader.cpp \
|
||||
src/map/demloader.cpp \
|
||||
src/map/ENC/atlasdata.cpp \
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -15,8 +15,8 @@
|
||||
<li>Opens GPX, TCX, FIT, KML, IGC, NMEA, SIGMA SLF, Suunto SML, LOC,
|
||||
OziExplorer (PLT, WPT, RTE), GeoJSON, SeeYou CUP,
|
||||
Garmin GPI & CSV, TomTom OV2 & ITN, ONmove OMD/GHP,
|
||||
TwoNav (TRK, RTE, WPT), GPSDump WPT and geotagged JPEG
|
||||
files.</li>
|
||||
TwoNav (TRK, RTE, WPT), GPSDump WPT, 70mai GPS logs and
|
||||
geotagged JPEG files.</li>
|
||||
<li>Opens geo URIs (RFC 5870).</li>
|
||||
<li>User-definable online maps (OpenStreetMap/Google tiles, WMTS,
|
||||
WMS, TMS, QuadTiles).</li>
|
||||
@ -113,6 +113,7 @@
|
||||
<mimetype>application/vnd.iho.s57-catalogue</mimetype>
|
||||
<mimetype>application/vnd.gpsdump.wpt</mimetype>
|
||||
<mimetype>application/vnd.gpstuner.gmi</mimetype>
|
||||
<mimetype>application/vnd.70mai.txt</mimetype>
|
||||
<mimetype>x-scheme-handler/geo</mimetype>
|
||||
</mimetypes>
|
||||
</component>
|
||||
|
@ -16,4 +16,4 @@ Icon=gpxsee
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Graphics;Viewer;Education;Geography;Maps;Sports;Qt
|
||||
MimeType=x-scheme-handler/geo;application/gpx+xml;application/vnd.garmin.tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/vnd.groundspeak.loc+xml;application/vnd.sigma.slf+xml;application/geo+json;application/vnd.naviter.seeyou.cup;application/vnd.garmin.gpi;application/vnd.suunto.sml+xml;image/jpeg;text/csv;application/vnd.garmin.img;application/vnd.garmin.jnx;application/vnd.garmin.gmap+xml;image/vnd.maptech.kap;application/vnd.oziexplorer.map;application/vnd.mapbox.mbtiles;application/vnd.twonav.rmap;application/vnd.trekbuddy.tba;application/vnd.gpxsee.map+xml;application/x-tar;image/tiff;application/vnd.google-earth.kmz;application/vnd.alpinequest.aqm;application/vnd.cgtk.gemf;application/vnd.rmaps.sqlite;application/vnd.osmdroid.sqlite;application/vnd.mapsforge.map;application/vnd.tomtom.ov2;application/vnd.tomtom.itn;application/vnd.esri.wld;application/vnd.onmove.omd;application/vnd.onmove.ghp;application/vnd.memory-map.qct;application/vnd.twonav.trk;application/vnd.twonav.rte;application/vnd.twonav.wpt;application/vnd.orux.map+xml;application/vnd.iho.s57-data;application/vnd.iho.s57-catalogue;application/vnd.gpsdump.wpt;application/vnd.gpstuner.gmi
|
||||
MimeType=x-scheme-handler/geo;application/gpx+xml;application/vnd.garmin.tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/vnd.groundspeak.loc+xml;application/vnd.sigma.slf+xml;application/geo+json;application/vnd.naviter.seeyou.cup;application/vnd.garmin.gpi;application/vnd.suunto.sml+xml;image/jpeg;text/csv;application/vnd.garmin.img;application/vnd.garmin.jnx;application/vnd.garmin.gmap+xml;image/vnd.maptech.kap;application/vnd.oziexplorer.map;application/vnd.mapbox.mbtiles;application/vnd.twonav.rmap;application/vnd.trekbuddy.tba;application/vnd.gpxsee.map+xml;application/x-tar;image/tiff;application/vnd.google-earth.kmz;application/vnd.alpinequest.aqm;application/vnd.cgtk.gemf;application/vnd.rmaps.sqlite;application/vnd.osmdroid.sqlite;application/vnd.mapsforge.map;application/vnd.tomtom.ov2;application/vnd.tomtom.itn;application/vnd.esri.wld;application/vnd.onmove.omd;application/vnd.onmove.ghp;application/vnd.memory-map.qct;application/vnd.twonav.trk;application/vnd.twonav.rte;application/vnd.twonav.wpt;application/vnd.orux.map+xml;application/vnd.iho.s57-data;application/vnd.iho.s57-catalogue;application/vnd.gpsdump.wpt;application/vnd.gpstuner.gmi;application/vnd.70mai.txt
|
||||
|
@ -188,6 +188,16 @@
|
||||
<glob pattern="*.wpt"/>
|
||||
</mime-type>
|
||||
|
||||
<mime-type type="application/vnd.70mai.txt">
|
||||
<comment>70mai GPS Log File</comment>
|
||||
<sub-class-of type="text/plain"/>
|
||||
<generic-icon name="text/plain"/>
|
||||
<magic>
|
||||
<match type="string" offset="0" value="$V02"/>
|
||||
</magic>
|
||||
<glob pattern="*.txt"/>
|
||||
</mime-type>
|
||||
|
||||
<!-- Maps -->
|
||||
|
||||
<mime-type type="application/vnd.garmin.img">
|
||||
|
@ -736,6 +736,20 @@
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>txt</string>
|
||||
</array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/vnd.70mai.txt</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>70mai GPS Log File</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<key>CFBundleURLTypes</key>
|
||||
@ -1718,6 +1732,27 @@
|
||||
<string>application/vnd.iho.s57-catalogue</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.70mai.txt</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>https://forum.mapillary.com/t/using-the-70mai-a810-dashcam-for-mapillary/9130/7?u=boris</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>70mai GPS Log File</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>txt</string>
|
||||
</array>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/vnd.70mai.txt</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
|
@ -265,6 +265,7 @@ Section "GPXSee" SEC_APP
|
||||
WriteRegStr HKCR ".gemf\OpenWithList" "GPXSee.exe" ""
|
||||
WriteRegStr HKCR ".000\OpenWithList" "GPXSee.exe" ""
|
||||
WriteRegStr HKCR ".031\OpenWithList" "GPXSee.exe" ""
|
||||
WriteRegStr HKCR ".txt\OpenWithList" "GPXSee.exe" ""
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
||||
@ -492,6 +493,7 @@ Section "Uninstall"
|
||||
DeleteRegValue HKCR ".gemf\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegValue HKCR ".000\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegValue HKCR ".031\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegValue HKCR ".txt\OpenWithList" "GPXSee.exe"
|
||||
DeleteRegKey HKCR "Applications\GPXSee.exe"
|
||||
|
||||
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
|
||||
|
@ -1193,11 +1193,13 @@ void GUI::loadData(const Data &data)
|
||||
_time += track.time();
|
||||
_movingTime += track.movingTime();
|
||||
const QDateTime date = track.date().toTimeZone(_options.timeZone.zone());
|
||||
if (date.isValid()) {
|
||||
if (_dateRange.first.isNull() || _dateRange.first > date)
|
||||
_dateRange.first = date;
|
||||
if (_dateRange.second.isNull() || _dateRange.second < date)
|
||||
_dateRange.second = date;
|
||||
}
|
||||
}
|
||||
_trackCount += data.tracks().count();
|
||||
|
||||
for (int i = 0; i < data.routes().count(); i++)
|
||||
|
@ -7,15 +7,18 @@ RFC 4180 parser with the following enchancements:
|
||||
- allows LF line ends in addition to CRLF line ends
|
||||
*/
|
||||
|
||||
bool CSV::readEntry(QByteArrayList &list)
|
||||
bool CSV::readEntry(QByteArrayList &list, int limit)
|
||||
{
|
||||
int state = 0;
|
||||
int state = 0, len = 0;
|
||||
char c;
|
||||
QByteArray field;
|
||||
|
||||
list.clear();
|
||||
|
||||
while (_device->getChar(&c)) {
|
||||
if (limit && ++len > limit)
|
||||
return false;
|
||||
|
||||
switch (state) {
|
||||
case 0:
|
||||
if (c == '\r')
|
||||
|
@ -9,7 +9,7 @@ public:
|
||||
CSV(QIODevice *device, char delimiter = ',')
|
||||
: _device(device), _delimiter(delimiter), _line(1) {}
|
||||
|
||||
bool readEntry(QByteArrayList &list);
|
||||
bool readEntry(QByteArrayList &list, int limit = 4096);
|
||||
bool atEnd() const {return _device->atEnd();}
|
||||
int line() const {return _line;}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "onmoveparsers.h"
|
||||
#include "twonavparser.h"
|
||||
#include "gpsdumpparser.h"
|
||||
#include "txtparser.h"
|
||||
#include "data.h"
|
||||
|
||||
|
||||
@ -49,6 +50,7 @@ static OMDParser omd;
|
||||
static GHPParser ghp;
|
||||
static TwoNavParser twonav;
|
||||
static GPSDumpParser gpsdump;
|
||||
static TXTParser txt;
|
||||
|
||||
static QMultiMap<QString, Parser*> parsers()
|
||||
{
|
||||
@ -82,6 +84,7 @@ static QMultiMap<QString, Parser*> parsers()
|
||||
map.insert("rte", &twonav);
|
||||
map.insert("wpt", &twonav);
|
||||
map.insert("wpt", &gpsdump);
|
||||
map.insert("txt", &txt);
|
||||
|
||||
return map;
|
||||
}
|
||||
@ -241,6 +244,7 @@ QString Data::formats()
|
||||
+ qApp->translate("Data", "SLF files") + " (*.slf);;"
|
||||
+ qApp->translate("Data", "SML files") + " (*.sml);;"
|
||||
+ qApp->translate("Data", "TCX files") + " (*.tcx);;"
|
||||
+ qApp->translate("Data", "70mai GPS log files") + " (*.txt);;"
|
||||
+ qApp->translate("Data", "TwoNav files") + " (*.rte *.trk *.wpt);;"
|
||||
+ qApp->translate("Data", "GPSDump files") + " (*.wpt);;"
|
||||
+ qApp->translate("Data", "All files") + " (*)";
|
||||
|
80
src/data/txtparser.cpp
Normal file
80
src/data/txtparser.cpp
Normal file
@ -0,0 +1,80 @@
|
||||
#include <QTimeZone>
|
||||
#include "common/csv.h"
|
||||
#include "txtparser.h"
|
||||
|
||||
static Coordinates coordinates(const QByteArrayList &entry)
|
||||
{
|
||||
bool lonOk, latOk;
|
||||
double lon = entry.at(3).toDouble(&lonOk);
|
||||
double lat = entry.at(2).toDouble(&latOk);
|
||||
|
||||
return (lonOk && latOk) ? Coordinates(lon, lat) : Coordinates();
|
||||
}
|
||||
|
||||
bool TXTParser::parse(QFile *file, QList<TrackData> &tracks,
|
||||
QList<RouteData> &routes, QList<Area> &polygons, QVector<Waypoint> &waypoints)
|
||||
{
|
||||
Q_UNUSED(routes);
|
||||
Q_UNUSED(polygons);
|
||||
Q_UNUSED(waypoints);
|
||||
CSV csv(file);
|
||||
QByteArrayList entry;
|
||||
SegmentData *sg = 0;
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
|
||||
while (!csv.atEnd()) {
|
||||
if (!csv.readEntry(entry)) {
|
||||
_errorString = "CSV parse error";
|
||||
_errorLine = csv.line() - 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entry.size() == 1) {
|
||||
if (entry.at(0) == "$V02") {
|
||||
tracks.append(TrackData(SegmentData()));
|
||||
sg = &tracks.last().last();
|
||||
} else {
|
||||
_errorString = "Invalid track start marker";
|
||||
_errorLine = csv.line() - 1;
|
||||
return false;
|
||||
}
|
||||
} else if (entry.size() == 13) {
|
||||
if (!sg) {
|
||||
_errorString = "Missing start marker";
|
||||
_errorLine = csv.line() - 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entry.at(1) == "A") {
|
||||
Coordinates c(coordinates(entry));
|
||||
if (!c.isValid()) {
|
||||
_errorString = "Invalid coordinates";
|
||||
_errorLine = csv.line() - 1;
|
||||
return false;
|
||||
}
|
||||
Trackpoint tp(c);
|
||||
|
||||
bool ok;
|
||||
qulonglong ts = entry.at(0).toULongLong(&ok);
|
||||
if (!ok) {
|
||||
_errorString = "Invalid timestamp";
|
||||
_errorLine = csv.line() - 1;
|
||||
return false;
|
||||
}
|
||||
tp.setTimestamp(QDateTime::fromSecsSinceEpoch(ts,
|
||||
QTimeZone::utc()));
|
||||
|
||||
uint speed = entry.at(5).toULong(&ok);
|
||||
if (ok)
|
||||
tp.setSpeed(speed * 0.01);
|
||||
|
||||
if (c != Coordinates(0, 0))
|
||||
sg->append(tp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
18
src/data/txtparser.h
Normal file
18
src/data/txtparser.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef TXTPARSER_H
|
||||
#define TXTPARSER_H
|
||||
|
||||
#include "parser.h"
|
||||
|
||||
class TXTParser : public Parser
|
||||
{
|
||||
bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
|
||||
QList<Area> &polygons, QVector<Waypoint> &waypoints);
|
||||
QString errorString() const {return _errorString;}
|
||||
int errorLine() const {return _errorLine;}
|
||||
|
||||
private:
|
||||
QString _errorString;
|
||||
int _errorLine;
|
||||
};
|
||||
|
||||
#endif // TXTPARSER_H
|
Loading…
x
Reference in New Issue
Block a user