1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01:00

Fixed loading of OziExplorer maps with missing (default) projection parameters

This commit is contained in:
Martin Tůma 2018-06-30 12:12:12 +02:00
parent b2a34bd10f
commit 201256d882

View File

@ -5,12 +5,12 @@
#include "mapfile.h"
static double parameter(const QString &str, bool *res)
static double parameter(const QString &str, bool *res, double def = 0.0)
{
QString field = str.trimmed();
if (field.isEmpty()) {
*res = true;
return NAN;
return def;
}
return field.toDouble(res);
@ -117,7 +117,7 @@ int MapFile::parse(QIODevice &device, QList<CalibrationPoint> &points,
setup = Projection::Setup(
parameter(list[1], &r[1]), parameter(list[2], &r[2]),
parameter(list[3], &r[3]), parameter(list[4], &r[4]),
parameter(list[3], &r[3], 1.0), parameter(list[4], &r[4]),
parameter(list[5], &r[5]), parameter(list[6], &r[6]),
parameter(list[7], &r[7]));