1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-26 08:24:24 +02:00

Use the correct axis order defaults for WMS/WMTS maps

This commit is contained in:
2018-04-05 20:38:23 +02:00
parent 3aa1ab4b4c
commit 81b3a517f8
22 changed files with 2023 additions and 1906 deletions

View File

@ -1,6 +1,7 @@
#include <QIODevice>
#include "utm.h"
#include "gcs.h"
#include "pcs.h"
#include "mapfile.h"
@ -163,18 +164,21 @@ const GCS *MapFile::createGCS(const QString &datum)
bool MapFile::createProjection(const GCS *gcs, const QString &name,
const Projection::Setup &setup, QList<CalibrationPoint> &points)
{
PCS pcs;
if (name == "Mercator")
_projection = Projection(gcs, 1024, setup, 9001);
pcs = PCS(gcs, 1024, setup, 9001);
else if (name == "Transverse Mercator")
_projection = Projection(gcs, 9807, setup, 9001);
else if (name == "Latitude/Longitude")
pcs = PCS(gcs, 9807, setup, 9001);
else if (name == "Latitude/Longitude") {
_projection = Projection(gcs);
else if (name == "Lambert Conformal Conic")
_projection = Projection(gcs, 9802, setup, 9001);
return true;
} else if (name == "Lambert Conformal Conic")
pcs = PCS(gcs, 9802, setup, 9001);
else if (name == "Albers Equal Area")
_projection = Projection(gcs, 9822, setup, 9001);
pcs = PCS(gcs, 9822, setup, 9001);
else if (name == "(A)Lambert Azimuthual Equal Area")
_projection = Projection(gcs, 9820, setup, 9001);
pcs = PCS(gcs, 9820, setup, 9001);
else if (name == "(UTM) Universal Transverse Mercator") {
int zone;
if (points.first().zone)
@ -185,45 +189,47 @@ bool MapFile::createProjection(const GCS *gcs, const QString &name,
_errorString = "Can not determine UTM zone";
return false;
}
_projection = Projection(gcs, 9807, UTM::setup(zone), 9001);
pcs = PCS(gcs, 9807, UTM::setup(zone), 9001);
} else if (name == "(NZTM2) New Zealand TM 2000")
_projection = Projection(gcs, 9807, Projection::Setup(0, 173.0, 0.9996,
1600000, 10000000, NAN, NAN), 9001);
pcs = PCS(gcs, 9807, Projection::Setup(0, 173.0, 0.9996, 1600000,
10000000, NAN, NAN), 9001);
else if (name == "(BNG) British National Grid")
_projection = Projection(gcs, 9807, Projection::Setup(49, -2, 0.999601,
400000, -100000, NAN, NAN), 9001);
pcs = PCS(gcs, 9807, Projection::Setup(49, -2, 0.999601, 400000,
-100000, NAN, NAN), 9001);
else if (name == "(IG) Irish Grid")
_projection = Projection(gcs, 9807, Projection::Setup(53.5, -8,
1.000035, 200000, 250000, NAN, NAN), 9001);
pcs = PCS(gcs, 9807, Projection::Setup(53.5, -8, 1.000035, 200000,
250000, NAN, NAN), 9001);
else if (name == "(SG) Swedish Grid")
_projection = Projection(gcs, 9807, Projection::Setup(0, 15.808278, 1,
1500000, 0, NAN, NAN), 9001);
pcs = PCS(gcs, 9807, Projection::Setup(0, 15.808278, 1, 1500000, 0, NAN,
NAN), 9001);
else if (name == "(I) France Zone I")
_projection = Projection(gcs, 9802, Projection::Setup(49.5, 2.337229,
NAN, 600000, 1200000, 48.598523, 50.395912), 9001);
pcs = PCS(gcs, 9802, Projection::Setup(49.5, 2.337229, NAN, 600000,
1200000, 48.598523, 50.395912), 9001);
else if (name == "(II) France Zone II")
_projection = Projection(gcs, 9802, Projection::Setup(46.8, 2.337229,
NAN, 600000, 2200000, 45.898919, 47.696014), 9001);
pcs = PCS(gcs, 9802, Projection::Setup(46.8, 2.337229, NAN, 600000,
2200000, 45.898919, 47.696014), 9001);
else if (name == "(III) France Zone III")
_projection = Projection(gcs, 9802, Projection::Setup(44.1, 2.337229,
NAN, 600000, 3200000, 43.199291, 44.996094), 9001);
pcs = PCS(gcs, 9802, Projection::Setup(44.1, 2.337229, NAN, 600000,
3200000, 43.199291, 44.996094), 9001);
else if (name == "(IV) France Zone IV")
_projection = Projection(gcs, 9802, Projection::Setup(42.165, 2.337229,
NAN, 234.358, 4185861.369, 41.560388, 42.767663), 9001);
pcs = PCS(gcs, 9802, Projection::Setup(42.165, 2.337229, NAN, 234.358,
4185861.369, 41.560388, 42.767663), 9001);
else if (name == "(VICGRID) Victoria Australia")
_projection = Projection(gcs, 9802, Projection::Setup(-37, 145, NAN,
2500000, 4500000, -36, -38), 9001);
pcs = PCS(gcs, 9802, Projection::Setup(-37, 145, NAN, 2500000, 4500000,
-36, -38), 9001);
else if (name == "(VG94) VICGRID94 Victoria Australia")
_projection = Projection(gcs, 9802, Projection::Setup(-37, 145, NAN,
2500000, 2500000, -36, -38), 9001);
pcs = PCS(gcs, 9802, Projection::Setup(-37, 145, NAN, 2500000, 2500000,
-36, -38), 9001);
else if (name == "(SUI) Swiss Grid")
_projection = Projection(gcs, 9815, Projection::Setup(46.570866,
7.26225, 1.0, 600000, 200000, 90.0, 90.0), 9001);
pcs = PCS(gcs, 9815, Projection::Setup(46.570866, 7.26225, 1.0, 600000,
200000, 90.0, 90.0), 9001);
else {
_errorString = QString("%1: Unknown map projection").arg(name);
return false;
}
_projection = Projection(&pcs);
return true;
}