-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmpparser.cpp
More file actions
643 lines (548 loc) · 21.9 KB
/
Copy pathmpparser.cpp
File metadata and controls
643 lines (548 loc) · 21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
#include "mpparser.h"
#include "osmmodel.h"
#include "osmstyle.h"
#include <QFile>
#include <QFileInfo>
#include <QTextStream>
#include <QDebug>
#include <QElapsedTimer>
#include <QRegularExpression>
MPParser::MPParser(QObject *parent)
: OsmAbstractParser(parent)
{
}
MPParser::~MPParser() = default;
QString MPParser::detectEncoding(const QString &fileName) {
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly)) {
return "UTF-8";
}
QByteArray data = file.read(1024);
file.close();
if (data.startsWith("\xEF\xBB\xBF")) {
return "UTF-8-BOM";
}
if (data.startsWith("\xFF\xFE")) {
return "UTF-16LE";
}
if (data.startsWith("\xFE\xFF")) {
return "UTF-16BE";
}
return "UTF-8";
}
QString MPParser::fromCodePage(const QByteArray &data, int codePage) {
QByteArray codecName;
switch (codePage) {
case 1250: codecName = "Windows-1250"; break;
case 1251: codecName = "Windows-1251"; break;
case 1252: codecName = "Windows-1252"; break;
case 1253: codecName = "Windows-1253"; break;
case 1254: codecName = "Windows-1254"; break;
case 1255: codecName = "Windows-1255"; break;
case 1256: codecName = "Windows-1256"; break;
case 1257: codecName = "Windows-1257"; break;
case 1258: codecName = "Windows-1258"; break;
case 28591: codecName = "ISO-8859-1"; break;
case 65001: codecName = "UTF-8"; break;
default: codecName = "Windows-1252"; break;
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QStringDecoder decoder(codecName.constData());
return decoder.decode(data);
#else
QTextCodec *codec = QTextCodec::codecForName(codecName);
if (codec) {
return codec->toUnicode(data);
}
return QString::fromLatin1(data);
#endif
}
bool MPParser::parseCoordPair(const QString &pair, double &lat, double &lon) {
QString trimmed = pair.trimmed();
if (trimmed.isEmpty()) return false;
QStringList parts = trimmed.split(QRegularExpression("[,\\s]+"), Qt::SkipEmptyParts);
if (parts.size() < 2) return false;
bool ok1, ok2;
lon = parts[0].toDouble(&ok1);
lat = parts[1].toDouble(&ok2);
if (!ok1 || !ok2) return false;
// Check if coordinates are within valid latitude/longitude range
if (lat > 90 || lat < -90 || lon > 180 || lon < -180) {
return false;
}
return true;
}
bool MPParser::parseCoordinates(const QString &dataStr, QList<QPair<double, double>> &coords) {
// Supports multiple formats:
// Data0= (lon,lat) (lon,lat) ...
// or Data0=(lon,lat),(lon,lat),...
// or Data0=lon,lat lon,lat ...
QString data = dataStr.trimmed();
if (data.isEmpty()) return false;
// Remove parentheses
data.replace('(', "");
data.replace(')', "");
// Split coordinate pairs by comma or space
QStringList coordPairs;
int i = 0;
while (i < data.length()) {
// Skip whitespace
while (i < data.length() && (data[i] == ' ' || data[i] == '\t')) i++;
// Find next number (possibly longitude)
int start = i;
while (i < data.length() && (data[i].isDigit() || data[i] == '.' || data[i] == '-' || data[i] == '+')) i++;
if (i == start) break; // No more numbers
// Skip comma or whitespace
while (i < data.length() && (data[i] == ',' || data[i] == ' ' || data[i] == '\t')) i++;
// Find latitude
int latStart = i;
while (i < data.length() && (data[i].isDigit() || data[i] == '.' || data[i] == '-' || data[i] == '+')) i++;
if (i == latStart) break;
QString lonStr = data.mid(start, i - start);
QString latStr = data.mid(latStart, i - latStart);
double lon = lonStr.toDouble();
double lat = latStr.toDouble();
if (lat >= -90 && lat <= 90 && lon >= -180 && lon <= 180) {
coords.append(qMakePair(lat, lon));
}
// Skip comma or whitespace
while (i < data.length() && (data[i] == ',' || data[i] == ' ' || data[i] == '\t')) i++;
}
return !coords.isEmpty();
}
int MPParser::mapPOIType(int garminType) {
// POI type mapping (based on Garmin type codes)
// Reference: https://wiki.openstreetmap.org/wiki/Polish_format
switch (garminType) {
// Cities and settlements
case 0x0001: return TagEnum::POI_CITY;
case 0x0002: return TagEnum::POI_CITY;
case 0x0003: return TagEnum::POI_CITY;
case 0x0004: return TagEnum::POI_CITY;
case 0x0005: return TagEnum::POI_CITY;
case 0x0006: return TagEnum::POI_CITY;
case 0x0007: return TagEnum::POI_CITY;
case 0x0008: return TagEnum::POI_CITY;
case 0x0009: return TagEnum::POI_CITY;
case 0x000A: return TagEnum::POI_CITY;
case 0x000D: return TagEnum::POI_CITY;
case 0x0011: return TagEnum::POI_CITY;
// Transportation
case 0x0020: return TagEnum::POI_HIGHWAY_EXIT;
case 0x0025: return TagEnum::POI_TOLL_BOOTH;
case 0x0059: return TagEnum::POI_AIRPORT;
// Service facilities
case 0x002F: // Gas station
case 0x02F01: return TagEnum::POI_FUEL;
case 0x002B01: return TagEnum::POI_HOTEL;
case 0x002B03: return TagEnum::POI_CAMPSITE;
case 0x002E: return TagEnum::POI_SHOPPING;
case 0x003002: return TagEnum::POI_HOSPITAL;
case 0x0043: return TagEnum::POI_MARINA;
case 0x0046: return TagEnum::POI_BAR;
case 0x0048: return TagEnum::POI_CAMPSITE;
case 0x0049: return TagEnum::POI_PARK;
case 0x004A: return TagEnum::POI_PICNIC;
// Landmarks
case 0x006401: return TagEnum::POI_BRIDGE;
case 0x006402: return TagEnum::BUILDING;
case 0x006500: return TagEnum::POI_WATER_FEATURE;
case 0x00650C: return TagEnum::POI_ISLAND;
case 0x00650D: return TagEnum::NATURAL_LAKE;
case 0x006600: return TagEnum::POI_LAND_FEATURE;
case 0x006606: return TagEnum::POI_CAPE;
case 0x006614: return TagEnum::NATURAL_ROCK;
// Culture
case 0x002C00: return TagEnum::POI_ATTRACTION;
case 0x002C02: return TagEnum::POI_MUSEUM;
// Other
default: return TagEnum::POI_DEFAULT;
}
}
int MPParser::mapPolylineType(int garminType) {
// Polyline type mapping
switch (garminType & 0x3F) {
case 0x01: return TagEnum::HIGHWAY_MOTORWAY;
case 0x02: return TagEnum::HIGHWAY_TRUNK;
case 0x03: return TagEnum::HIGHWAY_PRIMARY;
case 0x04: return TagEnum::HIGHWAY_SECONDARY;
case 0x05: return TagEnum::HIGHWAY_TERTIARY;
case 0x06: return TagEnum::HIGHWAY_RESIDENTIAL;
case 0x07: return TagEnum::HIGHWAY_UNCLASSIFIED;
case 0x08: return TagEnum::HIGHWAY_SERVICE;
case 0x09: return TagEnum::HIGHWAY_TRACK;
case 0x0A: return TagEnum::HIGHWAY_PATH;
case 0x0B: return TagEnum::HIGHWAY_FOOTWAY;
case 0x0C: return TagEnum::HIGHWAY_CYCLEWAY;
case 0x10: return TagEnum::HIGHWAY_MOTORWAY_LINK;
case 0x11: return TagEnum::HIGHWAY_TRUNK_LINK;
case 0x12: return TagEnum::HIGHWAY_PRIMARY_LINK;
case 0x13: return TagEnum::HIGHWAY_SECONDARY_LINK;
case 0x14: return TagEnum::HIGHWAY_TERTIARY_LINK;
case 0x16: return TagEnum::HIGHWAY_FOOTWAY;
case 0x1E: return TagEnum::BOUNDARY_ADMIN;
case 0x1F: return TagEnum::BOUNDARY_ADMIN;
case 0x20: return TagEnum::CONTOUR_MINOR;
case 0x21: return TagEnum::CONTOUR_MAJOR;
case 0x22: return TagEnum::RAILWAY;
default: return TagEnum::LINE_DEFAULT;
}
}
int MPParser::mapPolygonType(int garminType) {
// Polygon type mapping
switch (garminType & 0x7F) {
case 0x01: return TagEnum::LANDUSE_RESIDENTIAL;
case 0x02: return TagEnum::LANDUSE_COMMERCIAL;
case 0x03: return TagEnum::LANDUSE_INDUSTRIAL;
case 0x04: return TagEnum::LANDUSE_FOREST;
case 0x05: return TagEnum::LANDUSE_GRASS;
case 0x06: return TagEnum::LANDUSE_FARMLAND;
case 0x07: return TagEnum::LANDUSE_ORCHARD;
case 0x08: return TagEnum::LANDUSE_VINEYARD;
case 0x09: return TagEnum::LANDUSE_PASTURE;
case 0x0A: return TagEnum::LANDUSE_QUARRY;
case 0x0B: return TagEnum::LANDUSE_MILITARY;
case 0x0D: return TagEnum::BOUNDARY_NATIONAL_PARK;
case 0x0E: return TagEnum::LANDUSE_AIRPORT;
case 0x14: return TagEnum::BOUNDARY_NATIONAL_PARK;
case 0x15: return TagEnum::LEISURE_NATURE_RESERVE;
case 0x32: return TagEnum::NATURAL_WATER;
case 0x33: return TagEnum::NATURAL_WATER;
case 0x37: return TagEnum::NATURAL_WATER;
case 0x3C: return TagEnum::NATURAL_WATER;
case 0x3D: return TagEnum::NATURAL_LAKE;
case 0x4B: return TagEnum::AREA_DEFAULT;
case 0x4C: return TagEnum::NATURAL_WATER;
default: return TagEnum::AREA_DEFAULT;
}
}
int MPParser::mapGarminType(MPType mpType, int garminType) {
switch (mpType) {
case MP_POI:
return mapPOIType(garminType);
case MP_POLYLINE:
return mapPolylineType(garminType);
case MP_POLYGON:
return mapPolygonType(garminType);
default:
return TagEnum::UNKNOWN;
}
}
void MPParser::addFeature(ParseState &state, OsmModel &model, OsmStyle &style) {
Q_UNUSED(style);
const MPFeature &feature = state.currentFeature;
if (feature.coordinates.isEmpty()) {
return;
}
// Create corresponding OSM elements based on feature type
switch (feature.type) {
case MP_POI: {
// Point feature -> OsmNode
if (feature.coordinates.isEmpty()) return;
double lat = feature.coordinates[0].first;
double lon = feature.coordinates[0].second;
OsmNode node(state.featureCount, lat, lon);
// Create tags
int tagHead = -1;
// Name tag
if (!feature.label.isEmpty()) {
int keyId = model.registerKey(QStringLiteral("name"));
tagHead = model.addTag(keyId, feature.label, tagHead);
}
// Type tag
int tagType = mapGarminType(feature.type, feature.garminType);
int typeKeyId = model.registerKey(QStringLiteral("type"));
tagHead = model.addTag(typeKeyId, QString::number(tagType), tagHead);
// Additional attributes
if (!feature.city.isEmpty()) {
int keyId = model.registerKey(QStringLiteral("city"));
tagHead = model.addTag(keyId, feature.city, tagHead);
}
if (!feature.phone.isEmpty()) {
int keyId = model.registerKey(QStringLiteral("phone"));
tagHead = model.addTag(keyId, feature.phone, tagHead);
}
if (!feature.url.isEmpty()) {
int keyId = model.registerKey(QStringLiteral("url"));
tagHead = model.addTag(keyId, feature.url, tagHead);
}
node.setTagHead(tagHead);
model.addNode(node);
break;
}
case MP_POLYLINE:
case MP_POLYGON: {
// Line/polygon feature -> OsmWay
if (feature.coordinates.size() < 2) return;
OsmWay way(state.featureCount);
// Add nodes
int ndHead = -1;
for (int i = 0; i < feature.coordinates.size(); i++) {
double lat = feature.coordinates[i].first;
double lon = feature.coordinates[i].second;
OsmNode node(-(state.featureCount * 1000 + i), lat, lon);
int nodeIdx = model.addNode(node);
ndHead = model.addNd(nodeIdx, ndHead);
}
way.setNdHead(ndHead);
// Create tags
int tagHead = -1;
// Name tag
if (!feature.label.isEmpty()) {
int keyId = model.registerKey(QStringLiteral("name"));
tagHead = model.addTag(keyId, feature.label, tagHead);
}
// Type tag
int tagType = mapGarminType(feature.type, feature.garminType);
int typeKeyId = model.registerKey(QStringLiteral("type"));
tagHead = model.addTag(typeKeyId, QString::number(tagType), tagHead);
// Additional attributes
for (auto it = feature.extraAttributes.begin(); it != feature.extraAttributes.end(); ++it) {
int keyId = model.registerKey(it.key());
tagHead = model.addTag(keyId, it.value(), tagHead);
}
way.setTagHead(tagHead);
model.addWay(way);
break;
}
default:
break;
}
state.featureCount++;
}
bool MPParser::parseLine(const QString &line, ParseState &state) {
QString trimmed = line.trimmed();
// Skip empty lines and comments
if (trimmed.isEmpty() || trimmed.startsWith(';') || trimmed.startsWith('#')) {
return true;
}
// Check for section start [SECTION]
if (trimmed.startsWith('[') && trimmed.endsWith(']')) {
QString section = trimmed.mid(1, trimmed.length() - 2).toUpper();
// If currently parsing a feature, save it first
if (state.inFeature) {
state.features.append(state.currentFeature);
state.inFeature = false;
}
if (section == "IMG ID" || section == "IMG_ID") {
state.inHeader = true;
} else if (section == "POI") {
state.inFeature = true;
state.currentType = MP_POI;
state.currentFeature = MPFeature();
state.currentFeature.type = MP_POI;
} else if (section == "POLYLINE") {
state.inFeature = true;
state.currentType = MP_POLYLINE;
state.currentFeature = MPFeature();
state.currentFeature.type = MP_POLYLINE;
} else if (section == "POLYGON") {
state.inFeature = true;
state.currentType = MP_POLYGON;
state.currentFeature = MPFeature();
state.currentFeature.type = MP_POLYGON;
} else if (section == "END") {
state.inHeader = false;
if (state.inFeature) {
state.features.append(state.currentFeature);
state.inFeature = false;
}
}
return true;
}
// Parse Key=Value pairs
int eqPos = trimmed.indexOf('=');
if (eqPos < 0) return true;
QString key = trimmed.left(eqPos).trimmed().toUpper();
QString value = trimmed.mid(eqPos + 1).trimmed();
if (state.inHeader) {
// Parse file header
if (key == "NAME") {
state.header.name = value;
} else if (key == "CODEPAGE") {
state.header.codePage = value.toInt();
} else if (key == "ID") {
state.header.id = value.toInt();
} else if (key == "FAMILYID") {
state.header.familyId = value.toInt();
} else if (key == "PRODUCTID") {
state.header.productId = value.toInt();
} else if (key == "COPYRIGHT") {
state.header.copyright = value;
} else if (key == "MAPNAME") {
state.header.mapName = value;
}
return true;
}
if (state.inFeature) {
// Parse feature attributes
if (key == "TYPE" || key == "GARMIN_TYPE") {
// Supports 0x-prefixed hexadecimal
if (value.startsWith("0x") || value.startsWith("0X")) {
state.currentFeature.garminType = value.mid(2).toInt(nullptr, 16);
} else {
state.currentFeature.garminType = value.toInt();
}
} else if (key == "ENDLEVEL") {
state.currentFeature.endLevel = value.toInt();
} else if (key == "LABEL") {
state.currentFeature.label = value;
} else if (key == "LABEL2") {
state.currentFeature.label2 = value;
} else if (key == "CITY") {
state.currentFeature.city = value;
} else if (key == "REGION") {
state.currentFeature.region = value;
} else if (key == "COUNTRY") {
state.currentFeature.country = value;
} else if (key == "ZIP") {
state.currentFeature.zip = value;
} else if (key == "STREET") {
state.currentFeature.street = value;
} else if (key == "HOUSENUMBER") {
state.currentFeature.houseNumber = value;
} else if (key == "PHONE") {
state.currentFeature.phone = value;
} else if (key == "URL") {
state.currentFeature.url = value;
} else if (key == "DESCRIPTION") {
state.currentFeature.description = value;
} else if (key.startsWith("DATA")) {
// Coordinate data Data0, Data1, ...
QList<QPair<double, double>> coords;
if (parseCoordinates(value, coords)) {
state.currentFeature.coordinates.append(coords);
}
} else {
// Other attributes
state.currentFeature.extraAttributes[key.toLower()] = value;
}
return true;
}
return true;
}
bool MPParser::parse(const QString &fileName, OsmModel &model, OsmStyle &style) {
Q_UNUSED(style);
QElapsedTimer totalTimer;
totalTimer.start();
emitProgress(0, QStringLiteral("Loading map file: %1").arg(fileName));
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly)) {
emitProgress(0, QStringLiteral("Cannot open file: %1").arg(fileName));
emit parseFinished(false, tr("Cannot open file"));
return false;
}
model.clear();
// Read file contents
QByteArray rawData = file.readAll();
file.close();
// Detect encoding
QString encoding = detectEncoding(fileName);
ParseState state;
state.inHeader = false;
state.inFeature = false;
state.featureCount = 0;
state.header.codePage = 1252; // Default Windows-1252
QString content;
if (encoding == "UTF-8-BOM") {
content = QString::fromUtf8(rawData.mid(3));
} else if (encoding == "UTF-16LE") {
QByteArray data = rawData.mid(2);
content = QString::fromUtf16(reinterpret_cast<const char16_t*>(data.constData()), data.size() / 2);
} else if (encoding == "UTF-16BE") {
QByteArray data = rawData.mid(2);
const auto *src = reinterpret_cast<const uchar*>(data.constData());
qsizetype len = data.size() / 2;
QString tmp;
tmp.resize(len);
auto *dst = tmp.data();
for (qsizetype i = 0; i < len; i++) {
dst[i] = QChar((src[i*2] << 8) | src[i*2+1]);
}
content = tmp;
} else {
// Default to Latin-1, convert later based on CodePage
content = QString::fromLatin1(rawData);
}
// Parse line by line
QStringList lines = content.split('\n');
int totalLines = lines.size();
int poiCount = 0, polylineCount = 0, polygonCount = 0;
double latMin = 90, latMax = -90, lonMin = 180, lonMax = -180;
// Pre-register common keys
model.registerKey(QStringLiteral("source"));
model.registerKey(QStringLiteral("name"));
model.registerKey(QStringLiteral("type"));
model.registerKey(QStringLiteral("highway"));
model.registerKey(QStringLiteral("city"));
model.registerKey(QStringLiteral("phone"));
model.registerKey(QStringLiteral("url"));
model.registerKey(QStringLiteral("description"));
for (int i = 0; i < lines.size(); i++) {
// Progress report
if (i % 1000 == 0) {
int pct = 5 + (i * 85) / totalLines;
emitProgress(pct, QStringLiteral("Parsing... line %1/%2")
.arg(i).arg(totalLines));
}
QString line = lines[i];
if (line.endsWith('\r')) {
line.chop(1);
}
bool wasInFeature = state.inFeature;
parseLine(line, state);
// If a feature just ended, add it to the model
if (wasInFeature && !state.inFeature) {
// Already added to features list in parseLine
if (!state.features.isEmpty()) {
MPFeature f = state.features.last();
switch (f.type) {
case MP_POI: poiCount++; break;
case MP_POLYLINE: polylineCount++; break;
case MP_POLYGON: polygonCount++; break;
default: break;
}
// Add directly to model
state.currentFeature = f;
addFeature(state, model, style);
// Update bounds
for (const auto &coord : f.coordinates) {
if (coord.first < latMin) latMin = coord.first;
if (coord.first > latMax) latMax = coord.first;
if (coord.second < lonMin) lonMin = coord.second;
if (coord.second > lonMax) lonMax = coord.second;
}
}
}
}
// Process last feature
if (state.inFeature) {
switch (state.currentFeature.type) {
case MP_POI: poiCount++; break;
case MP_POLYLINE: polylineCount++; break;
case MP_POLYGON: polygonCount++; break;
default: break;
}
addFeature(state, model, style);
for (const auto &coord : state.currentFeature.coordinates) {
if (coord.first < latMin) latMin = coord.first;
if (coord.first > latMax) latMax = coord.first;
if (coord.second < lonMin) lonMin = coord.second;
if (coord.second > lonMax) lonMax = coord.second;
}
}
// Update bounds
OsmBounds bounds = model.bounds();
bounds.extend(latMin, lonMin);
bounds.extend(latMax, lonMax);
// Build draw list
emitProgress(95, QStringLiteral("Building draw list..."));
model.finalizeAfterLoad();
int64_t elapsed = totalTimer.elapsed();
qDebug() << "=== MP parsing total:" << elapsed << "ms, POIs:" << poiCount
<< "polylines:" << polylineCount << "polygons:" << polygonCount << "===";
emitProgress(100, QStringLiteral("Parsing complete (%1ms): POI=%2 lines=%3 polygons=%4")
.arg(elapsed).arg(poiCount).arg(polylineCount).arg(polygonCount));
emit parseFinished(true);
return true;
}