1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Added Latitude/Longitude projection

This commit is contained in:
Martin Tůma 2017-03-29 22:51:32 +02:00
parent b3e8081942
commit 3763d44662
3 changed files with 22 additions and 2 deletions

View File

@ -87,7 +87,8 @@ HEADERS += src/config.h \
src/atlas.h \
src/projection.h \
src/mercator.h \
src/transversemercator.h
src/transversemercator.h \
src/latlon.h
SOURCES += src/main.cpp \
src/gui.cpp \
src/poi.cpp \

15
src/latlon.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef LATLON_H
#define LATLON_H
#include "projection.h"
class LatLon : public Projection
{
public:
virtual QPointF ll2xy(const Coordinates &c) const
{return c.toPointF();}
virtual Coordinates xy2ll(const QPointF &p) const
{return Coordinates(p);}
};
#endif // LATLON_H

View File

@ -12,6 +12,7 @@
#include "wgs84.h"
#include "coordinates.h"
#include "matrix.h"
#include "latlon.h"
#include "mercator.h"
#include "transversemercator.h"
#include "offlinemap.h"
@ -31,7 +32,7 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
QByteArray line = device.readLine();
if (ln == 1) {
if (line.trimmed() != "OziExplorer Map Data File Version 2.2")
if (!line.trimmed().startsWith("OziExplorer Map Data File"))
return ln;
} else if (ln == 3)
_imgPath = line.trimmed();
@ -101,6 +102,9 @@ bool OfflineMap::createProjection(const QString &projection, double params[8])
_projection = new TransverseMercator(params[1], params[2], params[3],
params[4]);
return true;
} else if (projection == "Latitude/Longitude") {
_projection = new LatLon();
return true;
}
qWarning("%s: %s: unsupported map projection", qPrintable(_name),