mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Added Latitude/Longitude projection
This commit is contained in:
parent
b3e8081942
commit
3763d44662
@ -87,7 +87,8 @@ HEADERS += src/config.h \
|
|||||||
src/atlas.h \
|
src/atlas.h \
|
||||||
src/projection.h \
|
src/projection.h \
|
||||||
src/mercator.h \
|
src/mercator.h \
|
||||||
src/transversemercator.h
|
src/transversemercator.h \
|
||||||
|
src/latlon.h
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
src/gui.cpp \
|
src/gui.cpp \
|
||||||
src/poi.cpp \
|
src/poi.cpp \
|
||||||
|
15
src/latlon.h
Normal file
15
src/latlon.h
Normal 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
|
@ -12,6 +12,7 @@
|
|||||||
#include "wgs84.h"
|
#include "wgs84.h"
|
||||||
#include "coordinates.h"
|
#include "coordinates.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
|
#include "latlon.h"
|
||||||
#include "mercator.h"
|
#include "mercator.h"
|
||||||
#include "transversemercator.h"
|
#include "transversemercator.h"
|
||||||
#include "offlinemap.h"
|
#include "offlinemap.h"
|
||||||
@ -31,7 +32,7 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
|||||||
QByteArray line = device.readLine();
|
QByteArray line = device.readLine();
|
||||||
|
|
||||||
if (ln == 1) {
|
if (ln == 1) {
|
||||||
if (line.trimmed() != "OziExplorer Map Data File Version 2.2")
|
if (!line.trimmed().startsWith("OziExplorer Map Data File"))
|
||||||
return ln;
|
return ln;
|
||||||
} else if (ln == 3)
|
} else if (ln == 3)
|
||||||
_imgPath = line.trimmed();
|
_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],
|
_projection = new TransverseMercator(params[1], params[2], params[3],
|
||||||
params[4]);
|
params[4]);
|
||||||
return true;
|
return true;
|
||||||
|
} else if (projection == "Latitude/Longitude") {
|
||||||
|
_projection = new LatLon();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
qWarning("%s: %s: unsupported map projection", qPrintable(_name),
|
qWarning("%s: %s: unsupported map projection", qPrintable(_name),
|
||||||
|
Loading…
Reference in New Issue
Block a user