mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-21 06:14:23 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
50100b02dc | |||
6f7a90fb15 | |||
04091f21d5 | |||
89219a7948 | |||
d0ca202520 | |||
fafabef792 | |||
0da16199f8 | |||
7d7d62c786 | |||
d6a4e237d6 | |||
b6c7fe9cd1 | |||
b9396e6bbd |
@ -1,4 +1,4 @@
|
||||
version: 13.39.{build}
|
||||
version: 13.41.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
||||
} else {
|
||||
TARGET = GPXSee
|
||||
}
|
||||
VERSION = 13.39
|
||||
VERSION = 13.41
|
||||
|
||||
QT += core \
|
||||
gui \
|
||||
|
@ -43,6 +43,7 @@
|
||||
<file alias="casino-11.svg">icons/map/POI/casino-11.svg</file>
|
||||
<file alias="castle-11.svg">icons/map/POI/castle-11.svg</file>
|
||||
<file alias="cemetery-11.svg">icons/map/POI/cemetery-11.svg</file>
|
||||
<file alias="charging-station-11.svg">icons/map/POI/charging-station-11.svg</file>
|
||||
<file alias="cinema-11.svg">icons/map/POI/cinema-11.svg</file>
|
||||
<file alias="clothing-store-11.svg">icons/map/POI/clothing-store-11.svg</file>
|
||||
<file alias="college-11.svg">icons/map/POI/college-11.svg</file>
|
||||
|
4
icons/map/POI/charging-station-11.svg
Normal file
4
icons/map/POI/charging-station-11.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" id="charging-station-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
|
||||
<path d="M9.5,3H9V1.5C9,1.2239,8.7761,1,8.5,1S8,1.2239,8,1.5V3c0,0.5523,0.4477,1,1,1v4.25C9,8.3881,8.8881,8.5,8.75,8.5
	S8.5,8.3881,8.5,8.25V6.5C8.5,5.6716,7.8284,5,7,5V2c0-0.5523-0.4477-1-1-1H2C1.4477,1,1,1.4477,1,2v7c0,0.5523,0.4477,1,1,1h4
	c0.5523,0,1-0.4477,1-1V6c0.2761,0,0.5,0.2239,0.5,0.5v1.75c0,0.6904,0.5596,1.25,1.25,1.25S10,8.9404,10,8.25V3.5
	C10,3.2239,9.7761,3,9.5,3z M3.5,8.75H3L4,6H1.75L4.5,2.25H5L4,5h2.25L3.5,8.75z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 635 B |
@ -210,7 +210,12 @@
|
||||
<sub-class-of type="application/octet-stream"/>
|
||||
<generic-icon name="application/octet-stream"/>
|
||||
<magic>
|
||||
<match type="byte" offset="0" value="0xFF"/>
|
||||
<match type="big16" offset="0" value="0xFF00"/>
|
||||
<match type="big16" offset="0" value="0xFF01"/>
|
||||
<match type="big16" offset="0" value="0xFF02"/>
|
||||
<match type="big16" offset="0" value="0xFF03"/>
|
||||
<match type="big16" offset="0" value="0xFF04"/>
|
||||
<match type="big16" offset="0" value="0xFF05"/>
|
||||
</magic>
|
||||
<glob pattern="*.vkx"/>
|
||||
</mime-type>
|
||||
|
@ -49,7 +49,7 @@ Unicode true
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "13.39"
|
||||
!define VERSION "13.41"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -43,6 +43,7 @@
|
||||
#define I_RDOCAL 17017
|
||||
#define I_WTWDIS 17064
|
||||
#define I_CATBRT 17066
|
||||
#define I_CATBUN 17067
|
||||
#define I_HUNITS 17103
|
||||
|
||||
#endif // ENC_ATTRIBUTES_H
|
||||
|
@ -22,52 +22,6 @@ struct DR {
|
||||
char FieldTagSize;
|
||||
};
|
||||
|
||||
|
||||
const QVariant *ISO8211::Field::data(quint32 name, int idx) const
|
||||
{
|
||||
const QVector<QVariant> &v = _data.at(idx);
|
||||
|
||||
for (int i = 0; i < _subFields->size(); i++)
|
||||
if (_subFields->at(i) == name)
|
||||
return &v.at(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ISO8211::Field::subfield(quint32 name, int *val, int idx) const
|
||||
{
|
||||
bool ok;
|
||||
|
||||
const QVariant *v = data(name, idx);
|
||||
if (!v)
|
||||
return false;
|
||||
*val = v->toInt(&ok);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool ISO8211::Field::subfield(quint32 name, uint *val, int idx) const
|
||||
{
|
||||
bool ok;
|
||||
|
||||
const QVariant *v = data(name, idx);
|
||||
if (!v)
|
||||
return false;
|
||||
*val = v->toUInt(&ok);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool ISO8211::Field::subfield(quint32 name, QByteArray *val, int idx) const
|
||||
{
|
||||
const QVariant *v = data(name, idx);
|
||||
if (!v)
|
||||
return false;
|
||||
*val = v->toByteArray();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ISO8211::SubFieldDefinition ISO8211::fieldType(const QString &str, int cnt)
|
||||
{
|
||||
if (str == "A" || str == "I" || str == "R")
|
||||
@ -338,7 +292,7 @@ bool ISO8211::readRecord(Record &record)
|
||||
return false;
|
||||
}
|
||||
|
||||
record[i] = Field(def.tag, it->tags(), data);
|
||||
record[i] = Field(def.tag, data);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -15,22 +15,14 @@ public:
|
||||
class Field
|
||||
{
|
||||
public:
|
||||
Field() : _subFields(0) {}
|
||||
Field(quint32 tag, const QVector<quint32> &subFields, const Data &data)
|
||||
: _tag(tag), _subFields(&subFields), _data(data) {}
|
||||
Field() : _tag(0) {}
|
||||
Field(quint32 tag, const Data &data) : _tag(tag), _data(data) {}
|
||||
|
||||
quint32 tag() const {return _tag;}
|
||||
const Data &data() const {return _data;}
|
||||
|
||||
bool subfield(quint32 name, int *val, int idx = 0) const;
|
||||
bool subfield(quint32 name, uint *val, int idx = 0) const;
|
||||
bool subfield(quint32 name, QByteArray *val, int idx = 0) const;
|
||||
|
||||
private:
|
||||
const QVariant *data(quint32 name, int idx = 0) const;
|
||||
|
||||
quint32 _tag;
|
||||
const QVector<quint32> *_subFields;
|
||||
Data _data;
|
||||
};
|
||||
|
||||
@ -39,7 +31,6 @@ public:
|
||||
ISO8211(const QString &path) : _file(path) {}
|
||||
bool readDDR();
|
||||
bool readRecord(Record &record);
|
||||
|
||||
const QString &errorString() const {return _errorString;}
|
||||
|
||||
static const Field *field(const Record &record, quint32 name);
|
||||
|
@ -15,7 +15,6 @@ using namespace ENC;
|
||||
#define PRIM_L 2
|
||||
#define PRIM_A 3
|
||||
|
||||
constexpr quint32 RCID = ISO8211::NAME("RCID");
|
||||
constexpr quint32 SG2D = ISO8211::NAME("SG2D");
|
||||
constexpr quint32 SG3D = ISO8211::NAME("SG3D");
|
||||
constexpr quint32 FSPT = ISO8211::NAME("FSPT");
|
||||
@ -24,9 +23,6 @@ constexpr quint32 ATTF = ISO8211::NAME("ATTF");
|
||||
constexpr quint32 VRID = ISO8211::NAME("VRID");
|
||||
constexpr quint32 FRID = ISO8211::NAME("FRID");
|
||||
constexpr quint32 DSPM = ISO8211::NAME("DSPM");
|
||||
constexpr quint32 COMF = ISO8211::NAME("COMF");
|
||||
constexpr quint32 SOMF = ISO8211::NAME("SOMF");
|
||||
constexpr quint32 HUNI = ISO8211::NAME("HUNI");
|
||||
|
||||
static QMap<uint,uint> orderMapInit()
|
||||
{
|
||||
@ -74,10 +70,10 @@ static QMap<uint,uint> orderMapInit()
|
||||
map.insert(TYPE(I_TRNBSN), 32);
|
||||
map.insert(TYPE(HRBFAC), 33);
|
||||
map.insert(TYPE(I_HRBFAC), 33);
|
||||
map.insert(TYPE(PILPNT), 34);
|
||||
map.insert(TYPE(ACHBRT), 35);
|
||||
map.insert(TYPE(I_ACHBRT), 35);
|
||||
map.insert(TYPE(RADRFL), 36);
|
||||
map.insert(TYPE(RADRFL), 34);
|
||||
map.insert(TYPE(PILPNT), 35);
|
||||
map.insert(TYPE(ACHBRT), 36);
|
||||
map.insert(TYPE(I_ACHBRT), 36);
|
||||
map.insert(TYPE(CRANES), 37);
|
||||
map.insert(TYPE(I_CRANES), 37);
|
||||
map.insert(TYPE(I_WTWGAG), 38);
|
||||
@ -85,9 +81,10 @@ static QMap<uint,uint> orderMapInit()
|
||||
map.insert(TYPE(SLCONS), 40);
|
||||
map.insert(TYPE(LNDMRK), 41);
|
||||
map.insert(TYPE(SILTNK), 42);
|
||||
map.insert(TYPE(LNDELV), 43);
|
||||
map.insert(TYPE(SMCFAC), 44);
|
||||
map.insert(TYPE(BUISGL), 45);
|
||||
map.insert(TYPE(I_BUNSTA), 43);
|
||||
map.insert(TYPE(LNDELV), 44);
|
||||
map.insert(TYPE(SMCFAC), 45);
|
||||
map.insert(TYPE(BUISGL), 46);
|
||||
|
||||
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
|
||||
map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
|
||||
@ -106,8 +103,7 @@ static uint order(uint type)
|
||||
|
||||
static void warning(const ISO8211::Field &frid, uint prim)
|
||||
{
|
||||
uint rcid = 0xFFFFFFFF;
|
||||
frid.subfield(RCID, &rcid);
|
||||
uint rcid = frid.data().at(0).at(1).toUInt();
|
||||
|
||||
switch (prim) {
|
||||
case PRIM_P:
|
||||
@ -205,9 +201,12 @@ static bool polygonPointCb(const MapData::Poly *polygon, void *context)
|
||||
|| type == SUBTYPE(RESARE, 7) || type == SUBTYPE(I_RESARE, 7)
|
||||
|| type == SUBTYPE(RESARE, 9) || type == SUBTYPE(I_RESARE, 9)
|
||||
|| type == SUBTYPE(RESARE, 12) || type == SUBTYPE(I_RESARE, 12)
|
||||
|| type == SUBTYPE(RESARE, 14) || type == SUBTYPE(I_RESARE, 14)
|
||||
|| type == SUBTYPE(RESARE, 17) || type == SUBTYPE(I_RESARE, 17)
|
||||
|| type == SUBTYPE(RESARE, 22) || type == SUBTYPE(I_RESARE, 22)
|
||||
|| type == SUBTYPE(RESARE, 23) || type == SUBTYPE(I_RESARE, 23))
|
||||
|| type == SUBTYPE(RESARE, 23) || type == SUBTYPE(I_RESARE, 23)
|
||||
|| type == SUBTYPE(RESARE, 25) || type == SUBTYPE(I_RESARE, 25)
|
||||
|| type == SUBTYPE(RESARE, 26) || type == SUBTYPE(I_RESARE, 26))
|
||||
points->append(MapData::Point(baseType, polygon->bounds().center(),
|
||||
polygon->attributes(), polygon->HUNI(), true));
|
||||
|
||||
@ -378,6 +377,8 @@ MapData::Point::Point(uint type, const Coordinates &c, const Attributes &attr,
|
||||
subtype = I_CATACH;
|
||||
else if (type == MARKUL)
|
||||
subtype = CATMFA;
|
||||
else if (type == I_BUNSTA)
|
||||
subtype = I_CATBUN;
|
||||
|
||||
QList<QByteArray> list(_attr.value(subtype).split(','));
|
||||
std::sort(list.begin(), list.end());
|
||||
@ -762,7 +763,7 @@ MapData::Poly *MapData::polyObject(const ISO8211::Record &r,
|
||||
|
||||
bool MapData::processRecord(const ISO8211::Record &record,
|
||||
QVector<ISO8211::Record> &fe, RecordMap &vi, RecordMap &vc, RecordMap &ve,
|
||||
RecordMap &vf, uint &comf, uint &somf, uint &huni)
|
||||
uint &comf, uint &somf, uint &huni)
|
||||
{
|
||||
if (record.size() < 2)
|
||||
return false;
|
||||
@ -771,10 +772,14 @@ bool MapData::processRecord(const ISO8211::Record &record,
|
||||
quint32 tag = f.tag();
|
||||
|
||||
if (tag == VRID) {
|
||||
bool nmok, idok;
|
||||
|
||||
if (f.data().at(0).size() < 2)
|
||||
return false;
|
||||
int rcnm = f.data().at(0).at(0).toInt();
|
||||
uint rcid = f.data().at(0).at(1).toUInt();
|
||||
int rcnm = f.data().at(0).at(0).toInt(&nmok);
|
||||
uint rcid = f.data().at(0).at(1).toUInt(&idok);
|
||||
if (!(nmok && idok))
|
||||
return false;
|
||||
|
||||
switch (rcnm) {
|
||||
case RCNM_VI:
|
||||
@ -787,18 +792,23 @@ bool MapData::processRecord(const ISO8211::Record &record,
|
||||
ve.insert(rcid, record);
|
||||
break;
|
||||
case RCNM_VF:
|
||||
vf.insert(rcid, record);
|
||||
break;
|
||||
qWarning("Full topology/faces not supported");
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
} else if (tag == FRID) {
|
||||
fe.append(record);
|
||||
} else if (tag == DSPM) {
|
||||
if (!(f.subfield(COMF, &comf) && f.subfield(SOMF, &somf)))
|
||||
return false;
|
||||
if (!f.subfield(HUNI, &huni))
|
||||
bool cok, sok, hok;
|
||||
|
||||
if (f.data().at(0).size() < 12)
|
||||
return false;
|
||||
comf = f.data().at(0).at(10).toUInt(&cok);
|
||||
somf = f.data().at(0).at(11).toUInt(&sok);
|
||||
huni = f.data().at(0).at(7).toUInt(&hok);
|
||||
|
||||
return (cok && sok && hok);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -806,7 +816,7 @@ bool MapData::processRecord(const ISO8211::Record &record,
|
||||
|
||||
MapData::MapData(const QString &path)
|
||||
{
|
||||
RecordMap vi, vc, ve, vf;
|
||||
RecordMap vi, vc, ve;
|
||||
QVector<ISO8211::Record> fe;
|
||||
ISO8211 ddf(path);
|
||||
ISO8211::Record record;
|
||||
@ -820,17 +830,17 @@ MapData::MapData(const QString &path)
|
||||
if (!ddf.readDDR())
|
||||
return;
|
||||
while (ddf.readRecord(record))
|
||||
if (!processRecord(record, fe, vi, vc, ve, vf, comf, somf, huni))
|
||||
if (!processRecord(record, fe, vi, vc, ve, comf, somf, huni))
|
||||
qWarning("Invalid S-57 record");
|
||||
|
||||
for (int i = 0; i < fe.size(); i++) {
|
||||
const ISO8211::Record &r = fe.at(i);
|
||||
const ISO8211::Field &f = r.at(1);
|
||||
const ISO8211::Field &frid = r.at(1);
|
||||
|
||||
if (f.data().at(0).size() < 5)
|
||||
if (frid.data().at(0).size() < 5)
|
||||
continue;
|
||||
prim = f.data().at(0).at(2).toUInt();
|
||||
objl = f.data().at(0).at(4).toUInt();
|
||||
prim = frid.data().at(0).at(2).toUInt();
|
||||
objl = frid.data().at(0).at(4).toUInt();
|
||||
|
||||
switch (prim) {
|
||||
case PRIM_P:
|
||||
@ -846,7 +856,7 @@ MapData::MapData(const QString &path)
|
||||
pointBounds(point->pos(), min, max);
|
||||
_points.Insert(min, max, point);
|
||||
} else
|
||||
warning(f, prim);
|
||||
warning(frid, prim);
|
||||
}
|
||||
break;
|
||||
case PRIM_L:
|
||||
@ -854,14 +864,14 @@ MapData::MapData(const QString &path)
|
||||
rectcBounds(line->bounds(), min, max);
|
||||
_lines.Insert(min, max, line);
|
||||
} else
|
||||
warning(f, prim);
|
||||
warning(frid, prim);
|
||||
break;
|
||||
case PRIM_A:
|
||||
if ((poly = polyObject(r, vc, ve, comf, objl, huni))) {
|
||||
rectcBounds(poly->bounds(), min, max);
|
||||
_areas.Insert(min, max, poly);
|
||||
} else
|
||||
warning(f, prim);
|
||||
warning(frid, prim);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ private:
|
||||
|
||||
static bool processRecord(const ISO8211::Record &record,
|
||||
QVector<ISO8211::Record> &fe, RecordMap &vi, RecordMap &vc, RecordMap &ve,
|
||||
RecordMap &vf, uint &comf, uint &somf, uint &huni);
|
||||
uint &comf, uint &somf, uint &huni);
|
||||
|
||||
PolygonTree _areas;
|
||||
LineTree _lines;
|
||||
|
@ -122,6 +122,7 @@
|
||||
#define I_GATCON 17031
|
||||
#define I_SLCONS 17032
|
||||
#define I_WTWAXS 17051
|
||||
#define I_BUNSTA 17054
|
||||
#define I_TERMNL 17064
|
||||
#define I_TRNBSN 17065
|
||||
#define I_WTWGAG 17067
|
||||
|
@ -78,17 +78,24 @@ void Style::polygonStyle()
|
||||
_polygons[SUBTYPE(RESARE, 9)] = Polygon(QBrush(QColor(0xff, 0x00, 0x00),
|
||||
Qt::BDiagPattern));
|
||||
_polygons[SUBTYPE(RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png"));
|
||||
_polygons[SUBTYPE(RESARE, 14)] = Polygon(QImage(":/marine/safety-zone-line.png"));
|
||||
_polygons[SUBTYPE(RESARE, 17)] = Polygon(QImage(":/marine/entry-prohibited-line.png"));
|
||||
_polygons[SUBTYPE(RESARE, 22)] = Polygon(QImage(":/marine/sanctuary-line.png"));
|
||||
_polygons[SUBTYPE(RESARE, 23)] = Polygon(QImage(":/marine/nature-reserve-line.png"));
|
||||
_polygons[SUBTYPE(RESARE, 25)] = Polygon(Qt::NoBrush,
|
||||
QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
|
||||
_polygons[SUBTYPE(RESARE, 26)] = Polygon(QImage(":/marine/safety-zone-line.png"));
|
||||
_polygons[SUBTYPE(I_RESARE, 1)] = _polygons[SUBTYPE(RESARE, 1)];
|
||||
_polygons[SUBTYPE(I_RESARE, 2)] = _polygons[SUBTYPE(RESARE, 2)];
|
||||
_polygons[SUBTYPE(I_RESARE, 4)] = _polygons[SUBTYPE(RESARE, 4)];
|
||||
_polygons[SUBTYPE(I_RESARE, 9)] = _polygons[SUBTYPE(RESARE, 9)];
|
||||
_polygons[SUBTYPE(I_RESARE, 12)] = _polygons[SUBTYPE(RESARE, 12)];
|
||||
_polygons[SUBTYPE(I_RESARE, 14)] = _polygons[SUBTYPE(RESARE, 14)];
|
||||
_polygons[SUBTYPE(I_RESARE, 17)] = _polygons[SUBTYPE(RESARE, 17)];
|
||||
_polygons[SUBTYPE(I_RESARE, 22)] = _polygons[SUBTYPE(RESARE, 22)];
|
||||
_polygons[SUBTYPE(I_RESARE, 23)] = _polygons[SUBTYPE(RESARE, 23)];
|
||||
_polygons[SUBTYPE(I_RESARE, 25)] = _polygons[SUBTYPE(RESARE, 25)];
|
||||
_polygons[SUBTYPE(I_RESARE, 26)] = _polygons[SUBTYPE(RESARE, 26)];
|
||||
_polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
|
||||
_polygons[SUBTYPE(ACHARE, 2)] = _polygons[SUBTYPE(ACHARE, 1)];
|
||||
_polygons[SUBTYPE(ACHARE, 3)] = _polygons[SUBTYPE(ACHARE, 1)];
|
||||
@ -177,11 +184,12 @@ void Style::polygonStyle()
|
||||
<< SUBTYPE(I_RESARE, 5) << SUBTYPE(RESARE, 6) << SUBTYPE(I_RESARE, 6)
|
||||
<< SUBTYPE(RESARE, 7) << SUBTYPE(I_RESARE, 7) << SUBTYPE(RESARE, 9)
|
||||
<< SUBTYPE(I_RESARE, 9) << SUBTYPE(RESARE, 12) << SUBTYPE(I_RESARE, 12)
|
||||
<< SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 22)
|
||||
<< SUBTYPE(I_RESARE, 22) << SUBTYPE(RESARE, 23) << SUBTYPE(I_RESARE, 23)
|
||||
<< SUBTYPE(RESARE, 1) << TYPE(CBLARE) << TYPE(PIPARE) << TYPE(PRCARE)
|
||||
<< TYPE(I_TRNBSN) << SUBTYPE(MARKUL, 0) << SUBTYPE(MARKUL, 3)
|
||||
<< TYPE(CONZNE);
|
||||
<< SUBTYPE(RESARE, 14) << SUBTYPE(I_RESARE, 14) << SUBTYPE(RESARE, 17)
|
||||
<< SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 22) << SUBTYPE(I_RESARE, 22)
|
||||
<< SUBTYPE(RESARE, 23) << SUBTYPE(I_RESARE, 23) << SUBTYPE(RESARE, 25)
|
||||
<< SUBTYPE(I_RESARE, 25) << SUBTYPE(RESARE, 26) << SUBTYPE(I_RESARE, 26)
|
||||
<< TYPE(CBLARE) << TYPE(PIPARE) << TYPE(PRCARE) << TYPE(I_TRNBSN)
|
||||
<< SUBTYPE(MARKUL, 0) << SUBTYPE(MARKUL, 3) << TYPE(CONZNE);
|
||||
}
|
||||
|
||||
void Style::lineStyle(qreal ratio)
|
||||
@ -420,9 +428,12 @@ void Style::pointStyle(qreal ratio)
|
||||
_points[SUBTYPE(RESARE, 7)] = _points[SUBTYPE(RESARE, 4)];
|
||||
_points[SUBTYPE(RESARE, 9)] = _points[SUBTYPE(RESARE, 1)];
|
||||
_points[SUBTYPE(RESARE, 12)] = _points[SUBTYPE(RESARE, 1)];
|
||||
_points[SUBTYPE(RESARE, 14)] = _points[SUBTYPE(RESARE, 1)];
|
||||
_points[SUBTYPE(RESARE, 17)] = _points[SUBTYPE(RESARE, 1)];
|
||||
_points[SUBTYPE(RESARE, 22)] = _points[SUBTYPE(RESARE, 4)];
|
||||
_points[SUBTYPE(RESARE, 23)] = _points[SUBTYPE(RESARE, 4)];
|
||||
_points[SUBTYPE(RESARE, 25)] = _points[SUBTYPE(RESARE, 1)];
|
||||
_points[SUBTYPE(RESARE, 26)] = _points[SUBTYPE(RESARE, 1)];
|
||||
_points[SUBTYPE(I_RESARE, 1)] = _points[SUBTYPE(RESARE, 1)];
|
||||
_points[SUBTYPE(I_RESARE, 2)] = _points[SUBTYPE(RESARE, 2)];
|
||||
_points[SUBTYPE(I_RESARE, 4)] = _points[SUBTYPE(RESARE, 4)];
|
||||
@ -431,9 +442,19 @@ void Style::pointStyle(qreal ratio)
|
||||
_points[SUBTYPE(I_RESARE, 7)] = _points[SUBTYPE(RESARE, 7)];
|
||||
_points[SUBTYPE(I_RESARE, 9)] = _points[SUBTYPE(RESARE, 9)];
|
||||
_points[SUBTYPE(I_RESARE, 12)] = _points[SUBTYPE(RESARE, 12)];
|
||||
_points[SUBTYPE(I_RESARE, 14)] = _points[SUBTYPE(RESARE, 14)];
|
||||
_points[SUBTYPE(I_RESARE, 17)] = _points[SUBTYPE(RESARE, 17)];
|
||||
_points[SUBTYPE(I_RESARE, 22)] = _points[SUBTYPE(RESARE, 22)];
|
||||
_points[SUBTYPE(I_RESARE, 23)] = _points[SUBTYPE(RESARE, 23)];
|
||||
_points[SUBTYPE(I_RESARE, 25)] = _points[SUBTYPE(RESARE, 25)];
|
||||
_points[SUBTYPE(I_RESARE, 26)] = _points[SUBTYPE(RESARE, 26)];
|
||||
|
||||
_points[SUBTYPE(I_BUNSTA, 1)] = Point(svg2img(":/POI/fuel-11.svg", ratio),
|
||||
Small);
|
||||
_points[SUBTYPE(I_BUNSTA, 2)] = Point(svg2img(":/POI/drinking-water-11.svg",
|
||||
ratio), Small);
|
||||
_points[SUBTYPE(I_BUNSTA, 4)] = Point(svg2img(":/POI/charging-station-11.svg",
|
||||
ratio), Small);
|
||||
|
||||
_points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg",
|
||||
ratio), Small);
|
||||
@ -443,6 +464,8 @@ void Style::pointStyle(qreal ratio)
|
||||
ratio), Small);
|
||||
_points[SUBTYPE(SMCFAC, 13)] = Point(svg2img(":/POI/fuel-11.svg", ratio),
|
||||
Small);
|
||||
_points[SUBTYPE(SMCFAC, 14)] = Point(svg2img(":/POI/charging-station-11.svg",
|
||||
ratio), Small);
|
||||
_points[SUBTYPE(SMCFAC, 18)] = Point(svg2img(":/POI/toilet-11.svg", ratio),
|
||||
Small);
|
||||
_points[SUBTYPE(SMCFAC, 20)] = Point(svg2img(":/POI/telephone-11.svg",
|
||||
|
@ -13,12 +13,6 @@ using namespace ENC;
|
||||
#define TILE_SIZE 512
|
||||
|
||||
constexpr quint32 CATD = ISO8211::NAME("CATD");
|
||||
constexpr quint32 IMPL = ISO8211::NAME("IMPL");
|
||||
constexpr quint32 F1LE = ISO8211::NAME("FILE");
|
||||
constexpr quint32 SLAT = ISO8211::NAME("SLAT");
|
||||
constexpr quint32 WLON = ISO8211::NAME("WLON");
|
||||
constexpr quint32 NLAT = ISO8211::NAME("NLAT");
|
||||
constexpr quint32 ELON = ISO8211::NAME("ELON");
|
||||
|
||||
Range ENCAtlas::zooms(IntendedUsage usage)
|
||||
{
|
||||
@ -67,27 +61,19 @@ bool ENCAtlas::processRecord(const ISO8211::Record &record, QByteArray &file,
|
||||
if (record.size() < 2)
|
||||
return false;
|
||||
|
||||
const ENC::ISO8211::Field &f = record.at(1);
|
||||
const ENC::ISO8211::Field &field = record.at(1);
|
||||
|
||||
if (f.tag() == CATD) {
|
||||
QByteArray impl;
|
||||
|
||||
if (!f.subfield(IMPL, &impl))
|
||||
return false;
|
||||
if (!f.subfield(F1LE, &file))
|
||||
if (field.tag() == CATD) {
|
||||
if (field.data().at(0).size() < 10)
|
||||
return false;
|
||||
QByteArray impl = field.data().at(0).at(5).toByteArray();
|
||||
file = field.data().at(0).at(2).toByteArray();
|
||||
|
||||
if (impl == "BIN" && file.endsWith("000")) {
|
||||
QByteArray slat, wlon, nlat, elon;
|
||||
|
||||
if (!f.subfield(SLAT, &slat))
|
||||
return false;
|
||||
if (!f.subfield(WLON, &wlon))
|
||||
return false;
|
||||
if (!f.subfield(NLAT, &nlat))
|
||||
return false;
|
||||
if (!f.subfield(ELON, &elon))
|
||||
return false;
|
||||
QByteArray slat = field.data().at(0).at(6).toByteArray();
|
||||
QByteArray wlon = field.data().at(0).at(7).toByteArray();
|
||||
QByteArray nlat = field.data().at(0).at(8).toByteArray();
|
||||
QByteArray elon = field.data().at(0).at(9).toByteArray();
|
||||
|
||||
bool ok1, ok2, ok3, ok4;
|
||||
bounds = RectC(Coordinates(wlon.toDouble(&ok1), nlat.toDouble(&ok2)),
|
||||
|
@ -19,9 +19,7 @@ constexpr quint32 SG2D = ISO8211::NAME("SG2D");
|
||||
constexpr quint32 SG3D = ISO8211::NAME("SG3D");
|
||||
constexpr quint32 VRID = ISO8211::NAME("VRID");
|
||||
constexpr quint32 DSID = ISO8211::NAME("DSID");
|
||||
constexpr quint32 DSNM = ISO8211::NAME("DSNM");
|
||||
constexpr quint32 DSPM = ISO8211::NAME("DSPM");
|
||||
constexpr quint32 COMF = ISO8211::NAME("COMF");
|
||||
|
||||
static Range zooms(const RectC &bounds)
|
||||
{
|
||||
@ -116,10 +114,15 @@ bool ENCMap::processRecord(const ISO8211::Record &record,
|
||||
if (tag == VRID) {
|
||||
rv.append(record);
|
||||
} else if (tag == DSID) {
|
||||
if (!f.subfield(DSNM, &dsnm))
|
||||
if (f.data().at(0).size() < 5)
|
||||
return false;
|
||||
dsnm = f.data().at(0).at(4).toByteArray();
|
||||
} else if (tag == DSPM) {
|
||||
if (!f.subfield(COMF, &comf))
|
||||
bool ok;
|
||||
if (f.data().at(0).size() < 11)
|
||||
return false;
|
||||
comf = f.data().at(0).at(10).toUInt(&ok);
|
||||
if (!ok)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user