mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-10 09:14:28 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
bb6d6a4044 | |||
521369a6ec | |||
45a6cdeda0 | |||
12827edcb2 | |||
ee24bd54f1 | |||
cc22df3bf2 | |||
d7f0cda4b2 | |||
a898ff2807 | |||
9dd4e117f6 | |||
92deaaaf2b | |||
015a9187a0 |
@ -1,4 +1,4 @@
|
|||||||
version: 7.23.{build}
|
version: 7.24.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
|
@ -3,7 +3,7 @@ unix:!macx {
|
|||||||
} else {
|
} else {
|
||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
}
|
}
|
||||||
VERSION = 7.23
|
VERSION = 7.24
|
||||||
|
|
||||||
QT += core \
|
QT += core \
|
||||||
gui \
|
gui \
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "7.23"
|
!define VERSION "7.24"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}.exe"
|
OutFile "GPXSee-${VERSION}.exe"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "7.23"
|
!define VERSION "7.24"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.3">
|
<map xmlns="http://www.gpxsee.org/map/1.4">
|
||||||
<name>4UMaps</name>
|
<name>4UMaps</name>
|
||||||
<url>https://tileserver.4umaps.com/$z/$x/$y.png</url>
|
<url>https://tileserver.4umaps.com/$z/$x/$y.png</url>
|
||||||
<zoom min="2" max="15"/>
|
<zoom min="2" max="15"/>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.3" type="WMTS">
|
<map xmlns="http://www.gpxsee.org/map/1.4" type="WMTS">
|
||||||
<name>Antarctica</name>
|
<name>Antarctica</name>
|
||||||
<url type="REST">https://gis.ngdc.noaa.gov/arcgis/rest/services/antarctic/antarctic_basemap/MapServer/WMTS/1.0.0/WMTSCapabilities.xml</url>
|
<url type="REST">https://gis.ngdc.noaa.gov/arcgis/rest/services/antarctic/antarctic_basemap/MapServer/WMTS/1.0.0/WMTSCapabilities.xml</url>
|
||||||
<copyright>NOAA National Centers for Environmental Information (NCEI); International Bathymetric Chart of the Southern Ocean (IBCSO); General Bathymetric Chart of the Oceans (GEBCO); Natural Earth</copyright>
|
<copyright>NOAA National Centers for Environmental Information (NCEI); International Bathymetric Chart of the Southern Ocean (IBCSO); General Bathymetric Chart of the Oceans (GEBCO); Natural Earth</copyright>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.3">
|
<map xmlns="http://www.gpxsee.org/map/1.4">
|
||||||
<name>Open Street Map</name>
|
<name>Open Street Map</name>
|
||||||
<url>https://tile.openstreetmap.org/$z/$x/$y.png</url>
|
<url>https://tile.openstreetmap.org/$z/$x/$y.png</url>
|
||||||
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © OpenStreetMap (CC-BY-SA)</copyright>
|
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © OpenStreetMap (CC-BY-SA)</copyright>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.3">
|
<map xmlns="http://www.gpxsee.org/map/1.4">
|
||||||
<name>Open Topo Map</name>
|
<name>Open Topo Map</name>
|
||||||
<url>https://a.tile.opentopomap.org/$z/$x/$y.png</url>
|
<url>https://a.tile.opentopomap.org/$z/$x/$y.png</url>
|
||||||
<zoom max="17"/>
|
<zoom max="17"/>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.3">
|
<map xmlns="http://www.gpxsee.org/map/1.4">
|
||||||
<name>USGS Imagery</name>
|
<name>USGS Imagery</name>
|
||||||
<url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer/tile/$z/$y/$x</url>
|
<url>https://basemap.nationalmap.gov/ArcGIS/rest/services/USGSImageryOnly/MapServer/tile/$z/$y/$x</url>
|
||||||
<zoom min="2" max="15"/>
|
<zoom min="2" max="15"/>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map xmlns="http://www.gpxsee.org/map/1.3">
|
<map xmlns="http://www.gpxsee.org/map/1.4">
|
||||||
<name>USGS Topo</name>
|
<name>USGS Topo</name>
|
||||||
<url>https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/$z/$y/$x</url>
|
<url>https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/$z/$y/$x</url>
|
||||||
<zoom min="2" max="15"/>
|
<zoom min="2" max="15"/>
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPixmapCache>
|
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include "data/poi.h"
|
#include "data/poi.h"
|
||||||
#include "data/data.h"
|
#include "data/data.h"
|
||||||
@ -351,7 +350,6 @@ void MapView::setMap(Map *map)
|
|||||||
centerOn(nc);
|
centerOn(nc);
|
||||||
|
|
||||||
reloadMap();
|
reloadMap();
|
||||||
QPixmapCache::clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::setPOI(POI *poi)
|
void MapView::setPOI(POI *poi)
|
||||||
@ -982,7 +980,6 @@ void MapView::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio)
|
|||||||
|
|
||||||
_deviceRatio = deviceRatio;
|
_deviceRatio = deviceRatio;
|
||||||
_mapRatio = mapRatio;
|
_mapRatio = mapRatio;
|
||||||
QPixmapCache::clear();
|
|
||||||
|
|
||||||
QRectF vr(mapToScene(viewport()->rect()).boundingRect()
|
QRectF vr(mapToScene(viewport()->rect()).boundingRect()
|
||||||
.intersected(_map->bounds()));
|
.intersected(_map->bounds()));
|
||||||
|
@ -425,7 +425,7 @@ QMap<RGNFile::SegmentType, SubDiv::Segment> RGNFile::segments(Handle &hdl,
|
|||||||
quint32 ls = 0;
|
quint32 ls = 0;
|
||||||
SegmentType lt = (SegmentType)0;
|
SegmentType lt = (SegmentType)0;
|
||||||
|
|
||||||
for (quint16 mask = 0x1; mask <= 0x10; mask <<= 1) {
|
for (quint8 mask = 0x1; mask <= 0x10; mask <<= 1) {
|
||||||
if (subdiv->objects() & mask) {
|
if (subdiv->objects() & mask) {
|
||||||
if (ls) {
|
if (ls) {
|
||||||
quint16 po;
|
quint16 po;
|
||||||
|
@ -52,7 +52,7 @@ bool MapList::loadFile(const QString &path, bool *terminate)
|
|||||||
else if (GMAP::isGMAP(path)) {
|
else if (GMAP::isGMAP(path)) {
|
||||||
if (terminate)
|
if (terminate)
|
||||||
*terminate = true;
|
*terminate = true;
|
||||||
map = new IMGMap(path);
|
map = new IMGMap(path, this);
|
||||||
}
|
}
|
||||||
} else if (suffix == "jnx")
|
} else if (suffix == "jnx")
|
||||||
map = new JNXMap(path, this);
|
map = new JNXMap(path, this);
|
||||||
|
@ -300,7 +300,7 @@ Map *MapSource::loadMap(const QString &path, QString &errorString)
|
|||||||
case WMS:
|
case WMS:
|
||||||
return new WMSMap(config.name, WMS::Setup(config.url, config.layer,
|
return new WMSMap(config.name, WMS::Setup(config.url, config.layer,
|
||||||
config.style, config.format, config.crs, config.coordinateSystem,
|
config.style, config.format, config.crs, config.coordinateSystem,
|
||||||
config.dimensions, config.authorization));
|
config.dimensions, config.authorization), config.tileSize);
|
||||||
case TMS:
|
case TMS:
|
||||||
return new OnlineMap(config.name, config.url, config.zooms,
|
return new OnlineMap(config.name, config.url, config.zooms,
|
||||||
config.bounds, config.tileRatio, config.authorization,
|
config.bounds, config.tileRatio, config.authorization,
|
||||||
|
@ -169,6 +169,17 @@ void TileLoader::clearCache()
|
|||||||
dir.remove(list.at(i));
|
dir.remove(list.at(i));
|
||||||
|
|
||||||
_downloader->clearErrors();
|
_downloader->clearErrors();
|
||||||
|
|
||||||
|
QPixmapCache::clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TileLoader::setScaledSize(int size)
|
||||||
|
{
|
||||||
|
if (_scaledSize == size)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_scaledSize = size;
|
||||||
|
QPixmapCache::clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl TileLoader::tileUrl(const Tile &tile) const
|
QUrl TileLoader::tileUrl(const Tile &tile) const
|
||||||
|
@ -16,7 +16,7 @@ public:
|
|||||||
void setUrl(const QString &url) {_url = url;}
|
void setUrl(const QString &url) {_url = url;}
|
||||||
void setAuthorization(const Authorization &authorization)
|
void setAuthorization(const Authorization &authorization)
|
||||||
{_authorization = authorization;}
|
{_authorization = authorization;}
|
||||||
void setScaledSize(int size) {_scaledSize = size;}
|
void setScaledSize(int size);
|
||||||
void setQuadTiles(bool quadTiles) {_quadTiles = quadTiles;}
|
void setQuadTiles(bool quadTiles) {_quadTiles = quadTiles;}
|
||||||
|
|
||||||
void loadTilesAsync(QVector<Tile> &list);
|
void loadTilesAsync(QVector<Tile> &list);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <cmath>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
@ -7,6 +8,14 @@
|
|||||||
#include "wms.h"
|
#include "wms.h"
|
||||||
|
|
||||||
|
|
||||||
|
static inline double hint2denominator(double h)
|
||||||
|
{
|
||||||
|
/* Some WMS 1.1.1 servers use a 72dpi resolution by default. Using the usual
|
||||||
|
90dpi (0.28mm) resolution known from later standards (WMS 1.3, WMTS) does
|
||||||
|
make them return emty images in the "max" scale level. */
|
||||||
|
return h / (M_SQRT2 * 0.36e-3);
|
||||||
|
}
|
||||||
|
|
||||||
WMS::CTX::CTX(const Setup &setup) : setup(setup), formatSupported(false)
|
WMS::CTX::CTX(const Setup &setup) : setup(setup), formatSupported(false)
|
||||||
{
|
{
|
||||||
QStringList ll = setup.layer().split(',');
|
QStringList ll = setup.layer().split(',');
|
||||||
@ -28,7 +37,8 @@ void WMS::getMap(QXmlStreamReader &reader, CTX &ctx)
|
|||||||
{
|
{
|
||||||
while (reader.readNextStartElement()) {
|
while (reader.readNextStartElement()) {
|
||||||
if (reader.name() == "Format") {
|
if (reader.name() == "Format") {
|
||||||
if (reader.readElementText() == ctx.setup.format())
|
QString format(reader.readElementText());
|
||||||
|
if (format.left(format.indexOf(';')) == ctx.setup.format())
|
||||||
ctx.formatSupported = true;
|
ctx.formatSupported = true;
|
||||||
} else
|
} else
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
@ -97,7 +107,16 @@ void WMS::layer(QXmlStreamReader &reader, CTX &ctx,
|
|||||||
CRSs.append(reader.readElementText());
|
CRSs.append(reader.readElementText());
|
||||||
else if (reader.name() == "Style")
|
else if (reader.name() == "Style")
|
||||||
styles.append(style(reader));
|
styles.append(style(reader));
|
||||||
else if (reader.name() == "MinScaleDenominator") {
|
else if (reader.name() == "ScaleHint") {
|
||||||
|
QXmlStreamAttributes attr = reader.attributes();
|
||||||
|
double minHint = attr.value("min").toString().toDouble();
|
||||||
|
double maxHint = attr.value("max").toString().toDouble();
|
||||||
|
if (minHint > 0)
|
||||||
|
scaleDenominator.setMin(hint2denominator(minHint));
|
||||||
|
if (maxHint > 0)
|
||||||
|
scaleDenominator.setMax(hint2denominator(maxHint));
|
||||||
|
reader.skipCurrentElement();
|
||||||
|
} else if (reader.name() == "MinScaleDenominator") {
|
||||||
double sd = reader.readElementText().toDouble();
|
double sd = reader.readElementText().toDouble();
|
||||||
if (sd > 0)
|
if (sd > 0)
|
||||||
scaleDenominator.setMin(sd);
|
scaleDenominator.setMin(sd);
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#define CAPABILITIES_FILE "capabilities.xml"
|
#define CAPABILITIES_FILE "capabilities.xml"
|
||||||
#define TILE_SIZE 256
|
|
||||||
#define EPSILON 1e-6
|
#define EPSILON 1e-6
|
||||||
|
|
||||||
double WMSMap::sd2res(double scaleDenominator) const
|
double WMSMap::sd2res(double scaleDenominator) const
|
||||||
@ -25,7 +24,7 @@ QString WMSMap::tileUrl(const QString &version) const
|
|||||||
url = QString("%1%2version=%3&request=GetMap&bbox=$bbox"
|
url = QString("%1%2version=%3&request=GetMap&bbox=$bbox"
|
||||||
"&width=%4&height=%5&layers=%6&styles=%7&format=%8&transparent=true")
|
"&width=%4&height=%5&layers=%6&styles=%7&format=%8&transparent=true")
|
||||||
.arg(_setup.url(), _setup.url().contains('?') ? "&" : "?", version,
|
.arg(_setup.url(), _setup.url().contains('?') ? "&" : "?", version,
|
||||||
QString::number(TILE_SIZE), QString::number(TILE_SIZE), _setup.layer(),
|
QString::number(_tileSize), QString::number(_tileSize), _setup.layer(),
|
||||||
_setup.style(), _setup.format());
|
_setup.style(), _setup.format());
|
||||||
|
|
||||||
if (version >= "1.3.0")
|
if (version >= "1.3.0")
|
||||||
@ -100,9 +99,9 @@ bool WMSMap::loadWMS()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
WMSMap::WMSMap(const QString &name, const WMS::Setup &setup, QObject *parent)
|
WMSMap::WMSMap(const QString &name, const WMS::Setup &setup, int tileSize,
|
||||||
: Map(parent), _name(name), _setup(setup), _tileLoader(0), _zoom(0),
|
QObject *parent) : Map(parent), _name(name), _setup(setup), _tileLoader(0),
|
||||||
_mapRatio(1.0), _valid(false)
|
_zoom(0), _tileSize(tileSize), _mapRatio(1.0), _valid(false)
|
||||||
{
|
{
|
||||||
_tileLoader = new TileLoader(tilesDir(), this);
|
_tileLoader = new TileLoader(tilesDir(), this);
|
||||||
_tileLoader->setAuthorization(_setup.authorization());
|
_tileLoader->setAuthorization(_setup.authorization());
|
||||||
@ -180,7 +179,7 @@ Coordinates WMSMap::xy2ll(const QPointF &p)
|
|||||||
|
|
||||||
qreal WMSMap::tileSize() const
|
qreal WMSMap::tileSize() const
|
||||||
{
|
{
|
||||||
return (TILE_SIZE / _mapRatio);
|
return (_tileSize / _mapRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WMSMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
void WMSMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
||||||
@ -194,10 +193,10 @@ void WMSMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
|||||||
tiles.reserve((br.x() - tl.x()) * (br.y() - tl.y()));
|
tiles.reserve((br.x() - tl.x()) * (br.y() - tl.y()));
|
||||||
for (int i = tl.x(); i < br.x(); i++) {
|
for (int i = tl.x(); i < br.x(); i++) {
|
||||||
for (int j = tl.y(); j < br.y(); j++) {
|
for (int j = tl.y(); j < br.y(); j++) {
|
||||||
PointD ttl(_transform.img2proj(QPointF(i * TILE_SIZE,
|
PointD ttl(_transform.img2proj(QPointF(i * _tileSize,
|
||||||
j * TILE_SIZE)));
|
j * _tileSize)));
|
||||||
PointD tbr(_transform.img2proj(QPointF(i * TILE_SIZE + TILE_SIZE,
|
PointD tbr(_transform.img2proj(QPointF(i * _tileSize + _tileSize,
|
||||||
j * TILE_SIZE + TILE_SIZE)));
|
j * _tileSize + _tileSize)));
|
||||||
RectD bbox = (_cs.axisOrder() == CoordinateSystem::YX)
|
RectD bbox = (_cs.axisOrder() == CoordinateSystem::YX)
|
||||||
? RectD(PointD(tbr.y(), tbr.x()), PointD(ttl.y(), ttl.x()))
|
? RectD(PointD(tbr.y(), tbr.x()), PointD(ttl.y(), ttl.x()))
|
||||||
: RectD(ttl, tbr);
|
: RectD(ttl, tbr);
|
||||||
|
@ -14,7 +14,8 @@ class WMSMap : public Map
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WMSMap(const QString &name, const WMS::Setup &setup, QObject *parent = 0);
|
WMSMap(const QString &name, const WMS::Setup &setup, int tileSize,
|
||||||
|
QObject *parent = 0);
|
||||||
|
|
||||||
QString name() const {return _name;}
|
QString name() const {return _name;}
|
||||||
|
|
||||||
@ -58,6 +59,7 @@ private:
|
|||||||
RectC _bbox;
|
RectC _bbox;
|
||||||
RectD _bounds;
|
RectD _bounds;
|
||||||
int _zoom;
|
int _zoom;
|
||||||
|
int _tileSize;
|
||||||
qreal _mapRatio;
|
qreal _mapRatio;
|
||||||
|
|
||||||
bool _valid;
|
bool _valid;
|
||||||
|
@ -182,7 +182,8 @@ void WMTS::layer(QXmlStreamReader &reader, CTX &ctx)
|
|||||||
if (s == ctx.setup.style())
|
if (s == ctx.setup.style())
|
||||||
ctx.hasStyle = true;
|
ctx.hasStyle = true;
|
||||||
} else if (reader.name() == "Format") {
|
} else if (reader.name() == "Format") {
|
||||||
if (reader.readElementText() == ctx.setup.format())
|
QString format(reader.readElementText());
|
||||||
|
if (format.left(format.indexOf(';')) == ctx.setup.format())
|
||||||
ctx.hasFormat = true;
|
ctx.hasFormat = true;
|
||||||
} else
|
} else
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
|
Reference in New Issue
Block a user