mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-07 12:05:14 +01:00
Added missing namespace
This commit is contained in:
parent
81b3a517f8
commit
c5256b25e9
@ -123,8 +123,7 @@ HEADERS += src/config.h \
|
|||||||
src/map/wmsmap.h \
|
src/map/wmsmap.h \
|
||||||
src/map/wms.h \
|
src/map/wms.h \
|
||||||
src/map/crs.h \
|
src/map/crs.h \
|
||||||
src/map/coordinatesystem.h \
|
src/map/coordinatesystem.h
|
||||||
src/map/axisorder.h
|
|
||||||
SOURCES += src/main.cpp \
|
SOURCES += src/main.cpp \
|
||||||
src/common/coordinates.cpp \
|
src/common/coordinates.cpp \
|
||||||
src/common/rectc.cpp \
|
src/common/rectc.cpp \
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
#ifndef AXISORDER_H
|
|
||||||
#define AXISORDER_H
|
|
||||||
|
|
||||||
enum AxisOrder {Unknown, XY, YX};
|
|
||||||
|
|
||||||
#endif // AXISORDER_H
|
|
@ -1,11 +1,11 @@
|
|||||||
#ifndef COORDINATESYSTEM_H
|
#ifndef COORDINATESYSTEM_H
|
||||||
#define COORDINATESYSTEM_H
|
#define COORDINATESYSTEM_H
|
||||||
|
|
||||||
#include "axisorder.h"
|
|
||||||
|
|
||||||
class CoordinateSystem
|
class CoordinateSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
enum AxisOrder {Unknown, XY, YX};
|
||||||
|
|
||||||
CoordinateSystem() : _axisOrder(Unknown) {}
|
CoordinateSystem() : _axisOrder(Unknown) {}
|
||||||
CoordinateSystem(int code);
|
CoordinateSystem(int code);
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ Projection CRS::projection(const QString &crs)
|
|||||||
return Projection();
|
return Projection();
|
||||||
} else if (authority == "OGC") {
|
} else if (authority == "OGC") {
|
||||||
if (code == "CRS84")
|
if (code == "CRS84")
|
||||||
return Projection(GCS::gcs(4326), AxisOrder::XY);
|
return Projection(GCS::gcs(4326), CoordinateSystem::XY);
|
||||||
else
|
else
|
||||||
return Projection();
|
return Projection();
|
||||||
} else
|
} else
|
||||||
|
@ -15,18 +15,19 @@
|
|||||||
|
|
||||||
MapSource::Config::Config() : type(TMS), zooms(ZOOM_MIN, ZOOM_MAX),
|
MapSource::Config::Config() : type(TMS), zooms(ZOOM_MIN, ZOOM_MAX),
|
||||||
bounds(Coordinates(BOUNDS_LEFT, BOUNDS_TOP), Coordinates(BOUNDS_RIGHT,
|
bounds(Coordinates(BOUNDS_LEFT, BOUNDS_TOP), Coordinates(BOUNDS_RIGHT,
|
||||||
BOUNDS_BOTTOM)), format("image/png"), axisOrder(Unknown), rest(false) {}
|
BOUNDS_BOTTOM)), format("image/png"), axisOrder(CoordinateSystem::Unknown),
|
||||||
|
rest(false) {}
|
||||||
|
|
||||||
|
|
||||||
static AxisOrder axisOrder(QXmlStreamReader &reader)
|
static CoordinateSystem::AxisOrder axisOrder(QXmlStreamReader &reader)
|
||||||
{
|
{
|
||||||
QXmlStreamAttributes attr = reader.attributes();
|
QXmlStreamAttributes attr = reader.attributes();
|
||||||
if (attr.value("axis") == "yx")
|
if (attr.value("axis") == "yx")
|
||||||
return AxisOrder::YX;
|
return CoordinateSystem::YX;
|
||||||
else if (attr.value("axis") == "xy")
|
else if (attr.value("axis") == "xy")
|
||||||
return AxisOrder::XY;
|
return CoordinateSystem::XY;
|
||||||
else
|
else
|
||||||
return AxisOrder::Unknown;
|
return CoordinateSystem::Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
Range MapSource::zooms(QXmlStreamReader &reader)
|
Range MapSource::zooms(QXmlStreamReader &reader)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "common/range.h"
|
#include "common/range.h"
|
||||||
#include "common/rectc.h"
|
#include "common/rectc.h"
|
||||||
#include "downloader.h"
|
#include "downloader.h"
|
||||||
#include "axisorder.h"
|
#include "coordinatesystem.h"
|
||||||
|
|
||||||
class Map;
|
class Map;
|
||||||
class QXmlStreamReader;
|
class QXmlStreamReader;
|
||||||
@ -34,7 +34,7 @@ private:
|
|||||||
QString set;
|
QString set;
|
||||||
QString format;
|
QString format;
|
||||||
QString crs;
|
QString crs;
|
||||||
AxisOrder axisOrder;
|
CoordinateSystem::AxisOrder axisOrder;
|
||||||
bool rest;
|
bool rest;
|
||||||
QList<QPair<QString, QString> > dimensions;
|
QList<QPair<QString, QString> > dimensions;
|
||||||
Authorization authorization;
|
Authorization authorization;
|
||||||
|
@ -74,7 +74,7 @@ Projection::Projection(const PCS *pcs) : _gcs(pcs->gcs()), _units(pcs->units()),
|
|||||||
_axisOrder = pcs->coordinateSystem().axisOrder();
|
_axisOrder = pcs->coordinateSystem().axisOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
Projection::Projection(const GCS *gcs, AxisOrder axisOrder)
|
Projection::Projection(const GCS *gcs, CoordinateSystem::AxisOrder axisOrder)
|
||||||
: _gcs(gcs), _axisOrder(axisOrder), _geographic(true)
|
: _gcs(gcs), _axisOrder(axisOrder), _geographic(true)
|
||||||
{
|
{
|
||||||
_ct = new LatLon(gcs->angularUnits());
|
_ct = new LatLon(gcs->angularUnits());
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "common/coordinates.h"
|
#include "common/coordinates.h"
|
||||||
#include "linearunits.h"
|
#include "linearunits.h"
|
||||||
#include "axisorder.h"
|
#include "coordinatesystem.h"
|
||||||
|
|
||||||
class GCS;
|
class GCS;
|
||||||
class PCS;
|
class PCS;
|
||||||
@ -73,7 +73,8 @@ public:
|
|||||||
Projection() : _gcs(0), _ct(0), _geographic(false) {}
|
Projection() : _gcs(0), _ct(0), _geographic(false) {}
|
||||||
Projection(const Projection &p);
|
Projection(const Projection &p);
|
||||||
Projection(const PCS *pcs);
|
Projection(const PCS *pcs);
|
||||||
Projection(const GCS *gcs, AxisOrder axisOrder = YX);
|
Projection(const GCS *gcs, CoordinateSystem::AxisOrder axisOrder
|
||||||
|
= CoordinateSystem::YX);
|
||||||
~Projection();
|
~Projection();
|
||||||
|
|
||||||
Projection &operator=(const Projection &p);
|
Projection &operator=(const Projection &p);
|
||||||
@ -86,13 +87,13 @@ public:
|
|||||||
Coordinates xy2ll(const QPointF &p) const;
|
Coordinates xy2ll(const QPointF &p) const;
|
||||||
|
|
||||||
const LinearUnits &units() const {return _units;}
|
const LinearUnits &units() const {return _units;}
|
||||||
AxisOrder axisOrder() const {return _axisOrder;}
|
CoordinateSystem::AxisOrder axisOrder() const {return _axisOrder;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const GCS *_gcs;
|
const GCS *_gcs;
|
||||||
const CT *_ct;
|
const CT *_ct;
|
||||||
LinearUnits _units;
|
LinearUnits _units;
|
||||||
AxisOrder _axisOrder;
|
CoordinateSystem::AxisOrder _axisOrder;
|
||||||
bool _geographic;
|
bool _geographic;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "common/rectc.h"
|
#include "common/rectc.h"
|
||||||
#include "projection.h"
|
#include "projection.h"
|
||||||
#include "downloader.h"
|
#include "downloader.h"
|
||||||
#include "axisorder.h"
|
#include "coordinatesystem.h"
|
||||||
|
|
||||||
class QXmlStreamReader;
|
class QXmlStreamReader;
|
||||||
|
|
||||||
@ -18,7 +18,8 @@ public:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Setup(const QString &url, const QString &layer, const QString &style,
|
Setup(const QString &url, const QString &layer, const QString &style,
|
||||||
const QString &format, const QString &crs, AxisOrder axisOrder,
|
const QString &format, const QString &crs,
|
||||||
|
CoordinateSystem::AxisOrder axisOrder,
|
||||||
const Authorization &authorization = Authorization())
|
const Authorization &authorization = Authorization())
|
||||||
: _url(url), _layer(layer), _style(style), _format(format), _crs(crs),
|
: _url(url), _layer(layer), _style(style), _format(format), _crs(crs),
|
||||||
_axisOrder(axisOrder), _authorization(authorization) {}
|
_axisOrder(axisOrder), _authorization(authorization) {}
|
||||||
@ -29,7 +30,7 @@ public:
|
|||||||
const QString &style() const {return _style;}
|
const QString &style() const {return _style;}
|
||||||
const QString &format() const {return _format;}
|
const QString &format() const {return _format;}
|
||||||
const QString &crs() const {return _crs;}
|
const QString &crs() const {return _crs;}
|
||||||
AxisOrder axisOrder() const {return _axisOrder;}
|
CoordinateSystem::AxisOrder axisOrder() const {return _axisOrder;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString _url;
|
QString _url;
|
||||||
@ -37,7 +38,7 @@ public:
|
|||||||
QString _style;
|
QString _style;
|
||||||
QString _format;
|
QString _format;
|
||||||
QString _crs;
|
QString _crs;
|
||||||
AxisOrder _axisOrder;
|
CoordinateSystem::AxisOrder _axisOrder;
|
||||||
Authorization _authorization;
|
Authorization _authorization;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -87,12 +87,12 @@ bool WMSMap::loadWMS()
|
|||||||
_setup.authorization());
|
_setup.authorization());
|
||||||
|
|
||||||
if (wms.version() >= "1.3.0") {
|
if (wms.version() >= "1.3.0") {
|
||||||
if (_setup.axisOrder() == Unknown)
|
if (_setup.axisOrder() == CoordinateSystem::Unknown)
|
||||||
_axisOrder = _projection.axisOrder();
|
_axisOrder = _projection.axisOrder();
|
||||||
else
|
else
|
||||||
_axisOrder = _setup.axisOrder();
|
_axisOrder = _setup.axisOrder();
|
||||||
} else
|
} else
|
||||||
_axisOrder = XY;
|
_axisOrder = CoordinateSystem::XY;
|
||||||
|
|
||||||
computeZooms(wms.scaleDenominator());
|
computeZooms(wms.scaleDenominator());
|
||||||
updateTransform();
|
updateTransform();
|
||||||
@ -101,8 +101,8 @@ bool WMSMap::loadWMS()
|
|||||||
}
|
}
|
||||||
|
|
||||||
WMSMap::WMSMap(const QString &name, const WMS::Setup &setup, QObject *parent)
|
WMSMap::WMSMap(const QString &name, const WMS::Setup &setup, QObject *parent)
|
||||||
: Map(parent), _name(name), _setup(setup), _zoom(0), _axisOrder(Unknown),
|
: Map(parent), _name(name), _setup(setup), _zoom(0), _block(false),
|
||||||
_block(false), _valid(false)
|
_valid(false)
|
||||||
{
|
{
|
||||||
if (!QDir().mkpath(tilesDir())) {
|
if (!QDir().mkpath(tilesDir())) {
|
||||||
_errorString = "Error creating tiles dir";
|
_errorString = "Error creating tiles dir";
|
||||||
@ -221,7 +221,7 @@ void WMSMap::draw(QPainter *painter, const QRectF &rect)
|
|||||||
j * TILE_SIZE)));
|
j * TILE_SIZE)));
|
||||||
QPointF tbr(_transform.img2proj(QPointF(i * TILE_SIZE + TILE_SIZE
|
QPointF tbr(_transform.img2proj(QPointF(i * TILE_SIZE + TILE_SIZE
|
||||||
- 1, j * TILE_SIZE + TILE_SIZE - 1)));
|
- 1, j * TILE_SIZE + TILE_SIZE - 1)));
|
||||||
QRectF bbox = (_axisOrder == YX)
|
QRectF bbox = (_axisOrder == CoordinateSystem::YX)
|
||||||
? QRectF(QPointF(tbr.y(), tbr.x()), QPointF(ttl.y(), ttl.x()))
|
? QRectF(QPointF(tbr.y(), tbr.x()), QPointF(ttl.y(), ttl.x()))
|
||||||
: QRectF(ttl, tbr);
|
: QRectF(ttl, tbr);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ private:
|
|||||||
QVector<qreal> _zooms;
|
QVector<qreal> _zooms;
|
||||||
int _zoom;
|
int _zoom;
|
||||||
QRectF _boundingBox;
|
QRectF _boundingBox;
|
||||||
AxisOrder _axisOrder;
|
CoordinateSystem::AxisOrder _axisOrder;
|
||||||
bool _block;
|
bool _block;
|
||||||
|
|
||||||
bool _valid;
|
bool _valid;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "common/rectc.h"
|
#include "common/rectc.h"
|
||||||
#include "projection.h"
|
#include "projection.h"
|
||||||
#include "downloader.h"
|
#include "downloader.h"
|
||||||
#include "axisorder.h"
|
#include "coordinatesystem.h"
|
||||||
|
|
||||||
class QXmlStreamReader;
|
class QXmlStreamReader;
|
||||||
|
|
||||||
@ -21,7 +21,8 @@ public:
|
|||||||
public:
|
public:
|
||||||
Setup(const QString &url, const QString &layer, const QString &set,
|
Setup(const QString &url, const QString &layer, const QString &set,
|
||||||
const QString &style, const QString &format, bool rest,
|
const QString &style, const QString &format, bool rest,
|
||||||
AxisOrder axisOrder, const QList<QPair<QString, QString> > &dimensions,
|
CoordinateSystem::AxisOrder axisOrder,
|
||||||
|
const QList<QPair<QString, QString> > &dimensions,
|
||||||
const Authorization &authorization = Authorization()) :
|
const Authorization &authorization = Authorization()) :
|
||||||
_url(url), _layer(layer), _set(set), _style(style), _format(format),
|
_url(url), _layer(layer), _set(set), _style(style), _format(format),
|
||||||
_rest(rest), _axisOrder(axisOrder), _dimensions(dimensions),
|
_rest(rest), _axisOrder(axisOrder), _dimensions(dimensions),
|
||||||
@ -34,7 +35,7 @@ public:
|
|||||||
const QString &style() const {return _style;}
|
const QString &style() const {return _style;}
|
||||||
const QString &format() const {return _format;}
|
const QString &format() const {return _format;}
|
||||||
bool rest() const {return _rest;}
|
bool rest() const {return _rest;}
|
||||||
AxisOrder axisOrder() const {return _axisOrder;}
|
CoordinateSystem::AxisOrder axisOrder() const {return _axisOrder;}
|
||||||
const QList<QPair<QString, QString> > &dimensions() const
|
const QList<QPair<QString, QString> > &dimensions() const
|
||||||
{return _dimensions;}
|
{return _dimensions;}
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ public:
|
|||||||
QString _style;
|
QString _style;
|
||||||
QString _format;
|
QString _format;
|
||||||
bool _rest;
|
bool _rest;
|
||||||
AxisOrder _axisOrder;
|
CoordinateSystem::AxisOrder _axisOrder;
|
||||||
QList<QPair<QString, QString> > _dimensions;
|
QList<QPair<QString, QString> > _dimensions;
|
||||||
Authorization _authorization;
|
Authorization _authorization;
|
||||||
};
|
};
|
||||||
|
@ -26,7 +26,7 @@ bool WMTSMap::loadWMTS()
|
|||||||
_tileLoader = TileLoader(wmts.tileUrl(), tilesDir(),
|
_tileLoader = TileLoader(wmts.tileUrl(), tilesDir(),
|
||||||
_setup.authorization());
|
_setup.authorization());
|
||||||
|
|
||||||
if (_setup.axisOrder() == Unknown)
|
if (_setup.axisOrder() == CoordinateSystem::Unknown)
|
||||||
_axisOrder = _projection.axisOrder();
|
_axisOrder = _projection.axisOrder();
|
||||||
else
|
else
|
||||||
_axisOrder = _setup.axisOrder();
|
_axisOrder = _setup.axisOrder();
|
||||||
@ -37,8 +37,8 @@ bool WMTSMap::loadWMTS()
|
|||||||
}
|
}
|
||||||
|
|
||||||
WMTSMap::WMTSMap(const QString &name, const WMTS::Setup &setup, QObject *parent)
|
WMTSMap::WMTSMap(const QString &name, const WMTS::Setup &setup, QObject *parent)
|
||||||
: Map(parent), _name(name), _setup(setup), _zoom(0), _axisOrder(Unknown),
|
: Map(parent), _name(name), _setup(setup), _zoom(0), _block(false),
|
||||||
_block(false), _valid(false)
|
_valid(false)
|
||||||
{
|
{
|
||||||
if (!QDir().mkpath(tilesDir())) {
|
if (!QDir().mkpath(tilesDir())) {
|
||||||
_errorString = "Error creating tiles dir";
|
_errorString = "Error creating tiles dir";
|
||||||
@ -72,7 +72,7 @@ void WMTSMap::updateTransform()
|
|||||||
const WMTS::Zoom &z = _zooms.at(_zoom);
|
const WMTS::Zoom &z = _zooms.at(_zoom);
|
||||||
ReferencePoint tl, br;
|
ReferencePoint tl, br;
|
||||||
|
|
||||||
QPointF topLeft = (_axisOrder == YX)
|
QPointF topLeft = (_axisOrder == CoordinateSystem::YX)
|
||||||
? QPointF(z.topLeft().y(), z.topLeft().x()) : z.topLeft();
|
? QPointF(z.topLeft().y(), z.topLeft().x()) : z.topLeft();
|
||||||
|
|
||||||
qreal pixelSpan = sd2res(z.scaleDenominator());
|
qreal pixelSpan = sd2res(z.scaleDenominator());
|
||||||
|
@ -61,7 +61,7 @@ private:
|
|||||||
Projection _projection;
|
Projection _projection;
|
||||||
Transform _transform;
|
Transform _transform;
|
||||||
int _zoom;
|
int _zoom;
|
||||||
AxisOrder _axisOrder;
|
CoordinateSystem::AxisOrder _axisOrder;
|
||||||
bool _block;
|
bool _block;
|
||||||
|
|
||||||
bool _valid;
|
bool _valid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user