mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-21 14:24:24 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
2002b828dd | |||
71f0e1d0ac | |||
eb9767f2dd | |||
8d06ab6208 | |||
187cb77858 | |||
8167a995f6 |
@ -1,4 +1,4 @@
|
||||
version: 7.21.{build}
|
||||
version: 7.22.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
|
@ -4,7 +4,7 @@ GPXSee is a Qt-based GPS log file viewer and analyzer that supports all common G
|
||||
## Features
|
||||
* Opens GPX, TCX, FIT, KML, NMEA, IGC, CUP, SIGMA SLF, Suunto SML, LOC, GeoJSON, OziExplorer (PLT, RTE, WPT), Garmin GPI&CSV and geotagged JPEG files.
|
||||
* User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS, QuadTiles).
|
||||
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases, Garmin IMG & JNX maps, TwoNav RMaps, GeoTIFF images).
|
||||
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases, Garmin IMG/GMAP & JNX maps, TwoNav RMaps, GeoTIFF images).
|
||||
* Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts graphs.
|
||||
* Support for DEM files (SRTM HGT).
|
||||
* Support for multiple tracks in one view.
|
||||
|
@ -3,7 +3,7 @@ unix:!macx {
|
||||
} else {
|
||||
TARGET = GPXSee
|
||||
}
|
||||
VERSION = 7.21
|
||||
VERSION = 7.22
|
||||
|
||||
QT += core \
|
||||
gui \
|
||||
@ -383,7 +383,8 @@ macx {
|
||||
lang/gpxsee_tr.qm \
|
||||
lang/gpxsee_es.qm \
|
||||
lang/gpxsee_pt_BR.qm \
|
||||
lang/gpxsee_uk.qm
|
||||
lang/gpxsee_uk.qm \
|
||||
lang/gpxsee_hu.qm
|
||||
csv.path = Contents/Resources
|
||||
csv.files = pkg/csv
|
||||
maps.path = Contents/Resources
|
||||
|
@ -7,7 +7,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "7.21"
|
||||
!define VERSION "7.22"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}.exe"
|
||||
|
@ -7,7 +7,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "7.21"
|
||||
!define VERSION "7.22"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -112,7 +112,7 @@ void GUI::loadMaps()
|
||||
QString mapDir(ProgramPaths::mapDir());
|
||||
|
||||
if (!mapDir.isNull() && !_ml->loadDir(mapDir))
|
||||
qWarning("%s", qPrintable(_ml->errorString()));
|
||||
qWarning("%s", qPrintable(_ml->errorPath() + ": " + _ml->errorString()));
|
||||
|
||||
_map = new EmptyMap(this);
|
||||
}
|
||||
@ -1325,7 +1325,10 @@ bool GUI::loadMap(const QString &fileName)
|
||||
if (fileName.isEmpty())
|
||||
return false;
|
||||
|
||||
if (_ml->loadFile(fileName)) {
|
||||
QFileInfo fi(fileName);
|
||||
bool res = fi.isDir() ? _ml->loadDir(fileName) : _ml->loadFile(fileName);
|
||||
|
||||
if (res) {
|
||||
QAction *a = createMapAction(_ml->maps().last());
|
||||
_mapMenu->insertAction(_mapsEnd, a);
|
||||
_showMapAction->setEnabled(true);
|
||||
|
@ -44,37 +44,37 @@ static CUPParser cup;
|
||||
static GPIParser gpi;
|
||||
static SMLParser sml;
|
||||
|
||||
static QHash<QString, Parser*> parsers()
|
||||
static QMap<QString, Parser*> parsers()
|
||||
{
|
||||
QHash<QString, Parser*> hash;
|
||||
QMap<QString, Parser*> map;
|
||||
|
||||
hash.insert("gpx", &gpx);
|
||||
hash.insert("tcx", &tcx);
|
||||
hash.insert("kml", &kml);
|
||||
hash.insert("fit", &fit);
|
||||
hash.insert("csv", &csv);
|
||||
hash.insert("igc", &igc);
|
||||
hash.insert("nmea", &nmea);
|
||||
hash.insert("plt", &plt);
|
||||
hash.insert("wpt", &wpt);
|
||||
hash.insert("rte", &rte);
|
||||
hash.insert("loc", &loc);
|
||||
hash.insert("slf", &slf);
|
||||
map.insert("gpx", &gpx);
|
||||
map.insert("tcx", &tcx);
|
||||
map.insert("kml", &kml);
|
||||
map.insert("fit", &fit);
|
||||
map.insert("csv", &csv);
|
||||
map.insert("igc", &igc);
|
||||
map.insert("nmea", &nmea);
|
||||
map.insert("plt", &plt);
|
||||
map.insert("wpt", &wpt);
|
||||
map.insert("rte", &rte);
|
||||
map.insert("loc", &loc);
|
||||
map.insert("slf", &slf);
|
||||
#ifdef ENABLE_GEOJSON
|
||||
hash.insert("json", &geojson);
|
||||
hash.insert("geojson", &geojson);
|
||||
map.insert("json", &geojson);
|
||||
map.insert("geojson", &geojson);
|
||||
#endif // ENABLE_GEOJSON
|
||||
hash.insert("jpeg", &exif);
|
||||
hash.insert("jpg", &exif);
|
||||
hash.insert("cup", &cup);
|
||||
hash.insert("gpi", &gpi);
|
||||
hash.insert("sml", &sml);
|
||||
map.insert("jpeg", &exif);
|
||||
map.insert("jpg", &exif);
|
||||
map.insert("cup", &cup);
|
||||
map.insert("gpi", &gpi);
|
||||
map.insert("sml", &sml);
|
||||
|
||||
return hash;
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
QHash<QString, Parser*> Data::_parsers = parsers();
|
||||
QMap<QString, Parser*> Data::_parsers = parsers();
|
||||
bool Data::_useDEM = false;
|
||||
|
||||
void Data::processData(QList<TrackData> &trackData, QList<RouteData> &routeData)
|
||||
@ -130,7 +130,7 @@ Data::Data(const QString &fileName, bool poi)
|
||||
return;
|
||||
}
|
||||
|
||||
QHash<QString, Parser*>::iterator it;
|
||||
QMap<QString, Parser*>::iterator it;
|
||||
if ((it = _parsers.find(fi.suffix().toLower())) != _parsers.end()) {
|
||||
if (it.value()->parse(&file, trackData, routeData, _polygons,
|
||||
_waypoints)) {
|
||||
@ -166,17 +166,8 @@ Data::Data(const QString &fileName, bool poi)
|
||||
|
||||
QString Data::formats()
|
||||
{
|
||||
QStringList l(filter());
|
||||
qSort(l);
|
||||
QString supported;
|
||||
for (int i = 0; i < l.size(); i++) {
|
||||
supported += l.at(i);
|
||||
if (i != l.size() - 1)
|
||||
supported += " ";
|
||||
}
|
||||
|
||||
return
|
||||
qApp->translate("Data", "Supported files") + " (" + supported + ");;"
|
||||
qApp->translate("Data", "Supported files") + " (" + filter().join(" ") + ");;"
|
||||
+ qApp->translate("Data", "CSV files") + " (*.csv);;"
|
||||
+ qApp->translate("Data", "CUP files") + " (*.cup);;"
|
||||
+ qApp->translate("Data", "FIT files") + " (*.fit);;"
|
||||
@ -200,10 +191,10 @@ QString Data::formats()
|
||||
QStringList Data::filter()
|
||||
{
|
||||
QStringList filter;
|
||||
QHash<QString, Parser*>::iterator it;
|
||||
|
||||
for (it = _parsers.begin(); it != _parsers.end(); it++)
|
||||
filter << QString("*.%1").arg(it.key());
|
||||
for (QMap<QString, Parser*>::iterator it = _parsers.begin();
|
||||
it != _parsers.end(); it++)
|
||||
filter << "*." + it.key();
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define DATA_H
|
||||
|
||||
#include <QList>
|
||||
#include <QHash>
|
||||
#include <QMap>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include "waypoint.h"
|
||||
@ -42,7 +42,7 @@ private:
|
||||
QList<Area> _polygons;
|
||||
QVector<Waypoint> _waypoints;
|
||||
|
||||
static QHash<QString, Parser*> _parsers;
|
||||
static QMap<QString, Parser*> _parsers;
|
||||
static bool _useDEM;
|
||||
};
|
||||
|
||||
|
@ -12,56 +12,50 @@
|
||||
#include "maplist.h"
|
||||
|
||||
|
||||
bool MapList::loadMap(Map *map, const QString &path, bool dir)
|
||||
bool MapList::loadMap(Map *map, const QString &path)
|
||||
{
|
||||
if (map && map->isValid()) {
|
||||
_maps.append(map);
|
||||
return true;
|
||||
} else if (map) {
|
||||
if (dir)
|
||||
_errorString += path + ": " + map->errorString() + "\n";
|
||||
else
|
||||
_errorString = map->errorString();
|
||||
_errorPath = path;
|
||||
_errorString = map->errorString();
|
||||
return false;
|
||||
} else {
|
||||
if (dir)
|
||||
_errorString += path + ": " + "Unknown map format\n";
|
||||
else
|
||||
_errorString = "Unknown map format";
|
||||
_errorString = path;
|
||||
_errorString = "Unknown file format";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Map *MapList::loadSource(const QString &path, bool dir)
|
||||
Map *MapList::loadSource(const QString &path)
|
||||
{
|
||||
QString err;
|
||||
Map *map = MapSource::loadMap(path, err);
|
||||
Map *map = MapSource::loadMap(path, _errorString);
|
||||
|
||||
if (!map) {
|
||||
if (dir)
|
||||
_errorString += path + ": " + err + "\n";
|
||||
else
|
||||
_errorString = err;
|
||||
} else
|
||||
if (!map)
|
||||
_errorPath = path;
|
||||
else
|
||||
map->setParent(this);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
bool MapList::loadFile(const QString &path, bool *terminate, bool dir)
|
||||
bool MapList::loadFile(const QString &path, bool *terminate)
|
||||
{
|
||||
QFileInfo fi(path);
|
||||
QString suffix = fi.suffix().toLower();
|
||||
Map *map = 0;
|
||||
|
||||
if (Atlas::isAtlas(path)) {
|
||||
*terminate = true;
|
||||
if (terminate)
|
||||
*terminate = true;
|
||||
map = new Atlas(path, this);
|
||||
} else if (suffix == "xml") {
|
||||
if (MapSource::isMap(path) && !(map = loadSource(path, dir)))
|
||||
if (MapSource::isMap(path) && !(map = loadSource(path)))
|
||||
return false;
|
||||
else if (GMAP::isGMAP(path)) {
|
||||
*terminate = true;
|
||||
if (terminate)
|
||||
*terminate = true;
|
||||
map = new IMGMap(path);
|
||||
}
|
||||
} else if (suffix == "jnx")
|
||||
@ -74,10 +68,10 @@ bool MapList::loadFile(const QString &path, bool *terminate, bool dir)
|
||||
map = new RMap(path, this);
|
||||
else if (suffix == "img")
|
||||
map = new IMGMap(path, this);
|
||||
else
|
||||
else if (suffix == "map" || suffix == "tar")
|
||||
map = new OziMap(path, this);
|
||||
|
||||
if (!loadMap(map, path, dir)) {
|
||||
if (!loadMap(map, path)) {
|
||||
delete map;
|
||||
return false;
|
||||
}
|
||||
@ -85,7 +79,7 @@ bool MapList::loadFile(const QString &path, bool *terminate, bool dir)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MapList::loadDirR(const QString &path)
|
||||
bool MapList::loadDir(const QString &path)
|
||||
{
|
||||
QDir md(path);
|
||||
md.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
@ -99,10 +93,10 @@ bool MapList::loadDirR(const QString &path)
|
||||
bool terminate = false;
|
||||
|
||||
if (fi.isDir() && fi.fileName() != "set") {
|
||||
if (!loadDirR(fi.absoluteFilePath()))
|
||||
if (!loadDir(fi.absoluteFilePath()))
|
||||
ret = false;
|
||||
} else if (filter().contains("*." + suffix)) {
|
||||
if (!loadFile(fi.absoluteFilePath(), &terminate, true))
|
||||
if (!loadFile(fi.absoluteFilePath(), &terminate))
|
||||
ret = false;
|
||||
if (terminate)
|
||||
break;
|
||||
@ -112,26 +106,11 @@ bool MapList::loadDirR(const QString &path)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool MapList::loadFile(const QString &path)
|
||||
{
|
||||
bool atlas;
|
||||
|
||||
_errorString.clear();
|
||||
return loadFile(path, &atlas, false);
|
||||
}
|
||||
|
||||
bool MapList::loadDir(const QString &path)
|
||||
{
|
||||
_errorString.clear();
|
||||
return loadDirR(path);
|
||||
}
|
||||
|
||||
QString MapList::formats()
|
||||
{
|
||||
return
|
||||
tr("Supported files")
|
||||
+ " (*.img *.jnx *.map *.mbtiles *.rmap *.rtmap *.tar *.tba *.tif *.tiff *.xml);;"
|
||||
+ tr("Garmin IMG maps") + " (*.img *.xml);;"
|
||||
tr("Supported files") + " (" + filter().join(" ") + ");;"
|
||||
+ tr("Garmin IMG maps") + " (*.gmap *.gmapi *.img *.xml);;"
|
||||
+ tr("Garmin JNX maps") + " (*.jnx);;"
|
||||
+ tr("OziExplorer maps") + " (*.map);;"
|
||||
+ tr("MBTiles maps") + " (*.mbtiles);;"
|
||||
@ -144,7 +123,8 @@ QString MapList::formats()
|
||||
QStringList MapList::filter()
|
||||
{
|
||||
QStringList filter;
|
||||
filter << "*.img" << "*.jnx" << "*.map" << "*.tba" << "*.tar" << "*.xml"
|
||||
<< "*.tif" << "*.tiff" << "*.mbtiles" << "*.rmap" << "*.rtmap" << "*.img";
|
||||
filter << "*.gmap" << "*.gmapi" << "*.img" << "*.jnx" << "*.map"
|
||||
<< "*.mbtiles" << "*.rmap" << "*.rtmap" << "*.tar" << "*.tba" << "*.tif"
|
||||
<< "*.tiff" << "*.xml";
|
||||
return filter;
|
||||
}
|
||||
|
@ -13,23 +13,24 @@ class MapList : public QObject
|
||||
public:
|
||||
MapList(QObject *parent = 0) : QObject(parent) {}
|
||||
|
||||
bool loadFile(const QString &path);
|
||||
bool loadFile(const QString &path, bool *terminate = 0);
|
||||
bool loadDir(const QString &path);
|
||||
|
||||
const QList<Map*> &maps() const {return _maps;}
|
||||
|
||||
const QString &errorString() const {return _errorString;}
|
||||
const QString &errorPath() const {return _errorPath;}
|
||||
|
||||
static QString formats();
|
||||
static QStringList filter();
|
||||
|
||||
private:
|
||||
bool loadFile(const QString &path, bool *terminate, bool dir);
|
||||
bool loadDirR(const QString &path);
|
||||
Map *loadSource(const QString &path, bool dir);
|
||||
bool loadMap(Map *map, const QString &path, bool dir);
|
||||
Map *loadSource(const QString &path);
|
||||
bool loadMap(Map *map, const QString &path);
|
||||
|
||||
QList<Map*> _maps;
|
||||
QString _errorString;
|
||||
QString _errorPath;
|
||||
};
|
||||
|
||||
#endif // MAPLIST_H
|
||||
|
Reference in New Issue
Block a user