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

Hardcode web mercator (EPSG 3857) support

This commit is contained in:
Martin Tůma 2018-06-28 22:12:16 +02:00
parent 63cf4c039a
commit b2a34bd10f
7 changed files with 34 additions and 13 deletions

View File

@ -1572,7 +1572,6 @@ SWEREF99 / RT90 5 gon O emulation,3850,4619,17344,9001,9807,4530,8801,0,9110,880
NZGD2000 / NZCS2000,3851,4167,17964,9001,9802,4500,8821,-41,9110,8822,173,9110,8823,-37.3,9110,8824,-44.3,9110,8826,3000000,9001,8827,7000000,9001,,,
RSRGD2000 / DGLC2000,3852,4764,17966,9001,9802,4500,8821,-90,9110,8822,157,9110,8823,-76.4,9110,8824,-79.2,9110,8826,500000,9001,8827,0,9001,,,
County ST74,3854,4619,3853,9001,9807,4531,8801,0,9110,8802,18.0328332,9110,8805,0.99999506,9201,8806,100182.7406,9001,8807,-6500620.1207,9001,,,,,,
WGS 84 / Pseudo-Mercator,3857,4326,3856,9001,1024,4499,8801,0,9102,8802,0,9102,8806,0,9001,8807,0,9001,,,,,,,,,
ETRS89 / GK19FIN,3873,4258,3860,9001,9807,4500,8801,0,9102,8802,19,9102,8805,1,9201,8806,19500000,9001,8807,0,9001,,,,,,
ETRS89 / GK20FIN,3874,4258,3861,9001,9807,4500,8801,0,9102,8802,20,9102,8805,1,9201,8806,20500000,9001,8807,0,9001,,,,,,
ETRS89 / GK21FIN,3875,4258,3862,9001,9807,4500,8801,0,9102,8802,21,9102,8805,1,9201,8806,21500000,9001,8807,0,9001,,,,,,

Can't render this file because it is too large.

View File

@ -3,12 +3,18 @@
#include "common/wgs84.h"
#include "ellipsoid.h"
QMap<int, Ellipsoid> Ellipsoid::_ellipsoids = WGS84();
QMap<int, Ellipsoid> Ellipsoid::_ellipsoids = defaults();
QMap<int, Ellipsoid> Ellipsoid::WGS84()
const Ellipsoid &Ellipsoid::WGS84()
{
static Ellipsoid e(WGS84_RADIUS, WGS84_FLATTENING);
return e;
}
QMap<int, Ellipsoid> Ellipsoid::defaults()
{
QMap<int, Ellipsoid> map;
map.insert(7030, Ellipsoid(WGS84_RADIUS, WGS84_FLATTENING));
map.insert(7030, WGS84());
return map;
}

View File

@ -23,6 +23,7 @@ public:
bool isValid() const
{return !(std::isnan(_radius) || std::isnan(_flattening));}
static const Ellipsoid &WGS84();
static const Ellipsoid *ellipsoid(int id);
static void loadList(const QString &path);
@ -31,7 +32,7 @@ private:
double _flattening;
double _es, _e2s, _b;
static QMap<int, Ellipsoid> WGS84();
static QMap<int, Ellipsoid> defaults();
static QMap<int, Ellipsoid> _ellipsoids;
};

View File

@ -19,9 +19,6 @@ private:
GCS _gcs;
};
static Ellipsoid WGS84e = Ellipsoid(WGS84_RADIUS, WGS84_FLATTENING);
static Datum WGS84d = Datum(&WGS84e, 0.0, 0.0, 0.0);
static int parameter(const QString &str, bool *res)
{
QString field = str.trimmed();
@ -45,12 +42,19 @@ static double parameterd(const QString &str, bool *res)
}
QList<GCS::Entry> GCS::_gcss = WGS84();
QList<GCS::Entry> GCS::_gcss = defaults();
QList<GCS::Entry> GCS::WGS84()
const GCS &GCS::WGS84()
{
static Datum d(&Ellipsoid::WGS84(), 0.0, 0.0, 0.0);
static GCS g(d, 8901, 9122);
return g;
}
QList<GCS::Entry> GCS::defaults()
{
QList<GCS::Entry> list;
list.append(GCS::Entry(4326, 6326, "WGS 84", GCS(WGS84d, 8901, 9122)));
list.append(GCS::Entry(4326, 6326, "WGS 84", WGS84()));
return list;
}

View File

@ -29,13 +29,14 @@ public:
static const GCS *gcs(int geodeticDatum, int primeMeridian,
int angularUnits);
static const GCS *gcs(const QString &name);
static const GCS &WGS84();
static void loadList(const QString &path);
private:
class Entry;
static QList<Entry> WGS84();
static QList<Entry> defaults();
Datum _datum;
PrimeMeridian _primeMeridian;

View File

@ -16,7 +16,15 @@ private:
PCS _pcs;
};
QList<PCS::Entry> PCS::_pcss;
QList<PCS::Entry> PCS::_pcss = defaults();
QList<PCS::Entry> PCS::defaults()
{
QList<PCS::Entry> list;
list.append(PCS::Entry(3857, 3856, PCS(&GCS::WGS84(), 1024,
Projection::Setup(0, 0, NAN, 0, 0, NAN, NAN), 9001, 4499)));
return list;
}
static bool parameter(int key, double val, int units, Projection::Setup &setup)
{

View File

@ -38,6 +38,8 @@ public:
private:
class Entry;
static QList<PCS::Entry> defaults();
const GCS *_gcs;
Projection::Method _method;
Projection::Setup _setup;