Marble

StyleBuilder.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2007 Murad Tagirov <tmurad@gmail.com>
4// SPDX-FileCopyrightText: 2009 Patrick Spendrin <ps_ml@gmx.de>
5// SPDX-FileCopyrightText: 2015 Marius-Valeriu Stanciu <stanciumarius94@gmail.com>
6// SPDX-FileCopyrightText: 2016 Dennis Nienhüser <nienhueser@kde.org>
7//
8
9#include "StyleBuilder.h"
10
11#include "GeoDataGeometry.h"
12#include "GeoDataIconStyle.h"
13#include "GeoDataLabelStyle.h"
14#include "GeoDataLineString.h"
15#include "GeoDataLineStyle.h"
16#include "GeoDataLinearRing.h"
17#include "GeoDataPlacemark.h"
18#include "GeoDataPoint.h"
19#include "GeoDataPolyStyle.h"
20#include "GeoDataPolygon.h"
21#include "MarbleDirs.h"
22#include "OsmPlacemarkData.h"
23#include "OsmcSymbol.h"
24
25#include <QApplication>
26#include <QDate>
27#include <QDebug>
28#include <QFont>
29#include <QImage>
30#include <QScreen>
31#include <QSet>
32
33namespace Marble
34{
35
36class StyleBuilder::Private
37{
38public:
39 Private();
40
41 GeoDataStyle::ConstPtr presetStyle(GeoDataPlacemark::GeoDataVisualCategory visualCategory) const;
42
43 static GeoDataStyle::Ptr createStyle(qreal width,
44 qreal realWidth,
45 const QColor &color,
46 const QColor &outlineColor,
47 bool fill,
48 bool outline,
49 Qt::BrushStyle brushStyle,
50 Qt::PenStyle penStyle,
51 Qt::PenCapStyle capStyle,
52 bool lineBackground,
53 const QList<qreal> &dashPattern,
54 const QFont &font,
55 const QColor &fontColor = Qt::black,
56 const QString &texturePath = QString());
57 static GeoDataStyle::Ptr createPOIStyle(const QFont &font,
58 const QString &bitmap,
59 const QColor &textColor = Qt::black,
60 const QColor &color = QColor(0xBE, 0xAD, 0xAD),
61 const QColor &outline = QColor(0xBE, 0xAD, 0xAD).darker(),
62 bool fill = true,
63 bool renderOutline = true);
64 static GeoDataStyle::Ptr createOsmPOIStyle(const QFont &font,
65 const QString &bitmap,
66 const QColor &textColor = Qt::black,
67 const QColor &color = QColor(0xBE, 0xAD, 0xAD),
68 const QColor &outline = QColor(0xBE, 0xAD, 0xAD).darker());
69 static GeoDataStyle::Ptr createOsmPOIRingStyle(const QFont &font,
70 const QString &bitmap,
71 const QColor &textColor = Qt::black,
72 const QColor &color = QColor(0xBE, 0xAD, 0xAD),
73 const QColor &outline = QColor(0xBE, 0xAD, 0xAD).darker());
74 static GeoDataStyle::Ptr createOsmPOIAreaStyle(const QFont &font,
75 const QString &bitmap,
76 const QColor &textColor = Qt::black,
77 const QColor &color = QColor(0xBE, 0xAD, 0xAD),
78 const QColor &outline = QColor(0xBE, 0xAD, 0xAD).darker());
79 static GeoDataStyle::Ptr createHighwayStyle(const QColor &color,
80 const QColor &outlineColor,
81 const QFont &font,
82 const QColor &fontColor = Qt::black,
83 qreal width = 1,
84 qreal realWidth = 0.0,
85 Qt::PenStyle penStyle = Qt::SolidLine,
87 bool lineBackground = false);
88 GeoDataStyle::Ptr createWayStyle(const QColor &color,
89 const QColor &outlineColor,
90 bool fill = true,
91 bool outline = true,
93 const QString &texturePath = QString()) const;
94 static GeoDataStyle::Ptr
95 createIconWayStyle(const QColor &color, const QFont &font, const QColor &textColor, double lineWidth = 1.0, const QString &iconPath = QString());
96
97 GeoDataStyle::ConstPtr createRelationStyle(const StyleParameters &parameters);
98 GeoDataStyle::ConstPtr createPlacemarkStyle(const StyleParameters &parameters);
99 GeoDataStyle::ConstPtr adjustPisteStyle(const StyleParameters &parameters, const GeoDataStyle::ConstPtr &style);
100 static void adjustWayWidth(const StyleParameters &parameters, GeoDataLineStyle &lineStyle);
101
102 // Having an outline with the same color as the fill results in degraded
103 // performance and degraded display quality for no good reason
104 // Q_ASSERT( !(outline && color == outlineColor && brushStyle == Qt::SolidPattern) );
105 void initializeDefaultStyles();
106
107 static QColor effectColor(const QColor &color);
108
109 static QString createPaintLayerItem(const QString &itemType, GeoDataPlacemark::GeoDataVisualCategory visualCategory, const QString &subType = QString());
110
111 static void initializeOsmVisualCategories();
112 static void initializeMinimumZoomLevels();
113
114 int m_maximumZoomLevel;
115 QColor m_defaultLabelColor;
116 QFont m_defaultFont;
117 GeoDataStyle::Ptr m_defaultStyle[GeoDataPlacemark::LastIndex];
118 GeoDataStyle::Ptr m_styleTreeAutumn;
119 GeoDataStyle::Ptr m_styleTreeWinter;
120 bool m_defaultStyleInitialized;
121
124 QSet<QLocale::Country> m_oceanianCountries;
125
126 /**
127 * @brief s_visualCategories contains osm tag mappings to GeoDataVisualCategories
128 */
130 static int s_defaultMinZoomLevels[GeoDataPlacemark::LastIndex];
131 static bool s_defaultMinZoomLevelsInitialized;
133 static StyleEffect s_styleEffect;
134};
135
136QHash<StyleBuilder::OsmTag, GeoDataPlacemark::GeoDataVisualCategory> StyleBuilder::Private::s_visualCategories;
137int StyleBuilder::Private::s_defaultMinZoomLevels[GeoDataPlacemark::LastIndex];
138bool StyleBuilder::Private::s_defaultMinZoomLevelsInitialized = false;
139QHash<GeoDataPlacemark::GeoDataVisualCategory, qint64> StyleBuilder::Private::s_popularities;
140StyleEffect StyleBuilder::Private::s_styleEffect = NoEffect;
141
142StyleBuilder::Private::Private()
143 : m_maximumZoomLevel(15)
144 , m_defaultLabelColor(Qt::black)
145 , m_defaultFont(QStringLiteral("Sans Serif"))
146 , m_defaultStyle()
147 , m_defaultStyleInitialized(false)
148 , m_oceanianCountries({QLocale::Australia,
170{
171 m_oceanianCountries << QLocale::TuvaluCountry << QLocale::OutlyingOceania;
172 initializeMinimumZoomLevels();
173 for (int i = 0; i < GeoDataPlacemark::LastIndex; ++i) {
174 m_maximumZoomLevel = qMax(m_maximumZoomLevel, s_defaultMinZoomLevels[i]);
175 }
176}
177
178GeoDataStyle::Ptr StyleBuilder::Private::createPOIStyle(const QFont &font,
179 const QString &path,
180 const QColor &textColor,
181 const QColor &color,
182 const QColor &outlineColor,
183 bool fill,
184 bool renderOutline)
185{
186 GeoDataStyle::Ptr style = createStyle(1,
187 0,
188 effectColor(color),
189 effectColor(outlineColor),
190 fill,
191 renderOutline,
195 false,
196 QList<qreal>(),
197 font);
198 style->setIconStyle(GeoDataIconStyle(path));
199 auto const screen = QApplication::screens().first();
200 double const physicalSize = 6.0; // mm
201 int const pixelSize = qRound(physicalSize * screen->physicalDotsPerInch() / (IN2M * M2MM));
202 style->iconStyle().setSize(QSize(pixelSize, pixelSize));
203 style->setLabelStyle(GeoDataLabelStyle(font, effectColor(textColor)));
204 style->labelStyle().setAlignment(GeoDataLabelStyle::Center);
205 return style;
206}
207
208GeoDataStyle::Ptr
209StyleBuilder::Private::createOsmPOIStyle(const QFont &font, const QString &imagePath, const QColor &textColor, const QColor &color, const QColor &outlineColor)
210{
211 QString const path = MarbleDirs::path(QLatin1StringView("svg/osmcarto/svg/") + imagePath + QLatin1StringView(".svg"));
212 return createPOIStyle(font, path, textColor, color, outlineColor, false, false);
213}
214
215GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIRingStyle(const QFont &font,
216 const QString &imagePath,
217 const QColor &textColor,
218 const QColor &color,
219 const QColor &outlineColor)
220{
221 QString const path = MarbleDirs::path(QLatin1StringView("svg/osmcarto/svg/") + imagePath + QLatin1StringView(".svg"));
222 return createPOIStyle(font, path, textColor, color, outlineColor, false, true);
223}
224
225GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIAreaStyle(const QFont &font,
226 const QString &imagePath,
227 const QColor &textColor,
228 const QColor &color,
229 const QColor &outlineColor)
230{
231 QString const path = MarbleDirs::path(QLatin1StringView("svg/osmcarto/svg/") + imagePath + QLatin1StringView(".svg"));
232 return createPOIStyle(font, path, textColor, color, outlineColor, true, false);
233}
234
235GeoDataStyle::Ptr StyleBuilder::Private::createHighwayStyle(const QColor &color,
236 const QColor &outlineColor,
237 const QFont &font,
238 const QColor &fontColor,
239 qreal width,
240 qreal realWidth,
241 Qt::PenStyle penStyle,
242 Qt::PenCapStyle capStyle,
243 bool lineBackground)
244{
245 return createStyle(width,
246 realWidth,
247 color,
248 outlineColor,
249 true,
250 true,
252 penStyle,
253 capStyle,
254 lineBackground,
255 QList<qreal>(),
256 font,
257 fontColor);
258}
259
260GeoDataStyle::Ptr StyleBuilder::Private::createWayStyle(const QColor &color,
261 const QColor &outlineColor,
262 bool fill,
263 bool outline,
264 Qt::BrushStyle brushStyle,
265 const QString &texturePath) const
266{
267 return createStyle(1,
268 0,
269 color,
270 outlineColor,
271 fill,
272 outline,
273 brushStyle,
276 false,
277 QList<qreal>(),
278 m_defaultFont,
279 Qt::black,
280 texturePath);
281}
282
283GeoDataStyle::Ptr
284StyleBuilder::Private::createIconWayStyle(const QColor &color, const QFont &font, const QColor &textColor, double lineWidth, const QString &iconPath)
285{
286 auto const path = iconPath.isEmpty() ? iconPath : MarbleDirs::path(iconPath);
287 auto style = createPOIStyle(font, path, textColor, color, color, true, true);
288 style->lineStyle().setWidth(float(lineWidth));
289 return style;
290}
291
292GeoDataStyle::ConstPtr StyleBuilder::Private::createRelationStyle(const StyleParameters &parameters)
293{
294 Q_ASSERT(parameters.relation);
295 const GeoDataPlacemark *const placemark = parameters.placemark;
296 auto const visualCategory = placemark->visualCategory();
297 bool const isHighway = visualCategory >= GeoDataPlacemark::HighwaySteps && visualCategory <= GeoDataPlacemark::HighwayMotorway;
298 bool const isRailway = visualCategory >= GeoDataPlacemark::RailwayRail && visualCategory <= GeoDataPlacemark::RailwayFunicular;
299 if (isHighway || isRailway) {
300 if (parameters.relation->relationType() == GeoDataRelation::RouteHiking
301 && parameters.relation->osmData().containsTagKey(QStringLiteral("osmc:symbol"))) {
302 QString const osmcSymbolValue = parameters.relation->osmData().tagValue(QStringLiteral("osmc:symbol"));
303 // Take cached Style instance if possible
304 QString const cacheKey = QStringLiteral("/route/hiking/%1").arg(osmcSymbolValue);
305 if (m_styleCache.contains(cacheKey)) {
306 return m_styleCache[cacheKey];
307 }
308
309 auto style = presetStyle(visualCategory);
310 auto lineStyle = style->lineStyle();
311 if (isHighway) {
312 adjustWayWidth(parameters, lineStyle);
313 }
314 auto iconStyle = style->iconStyle();
315 GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
316 OsmcSymbol symbol = OsmcSymbol(osmcSymbolValue);
317 lineStyle.setColor(symbol.wayColor());
318 iconStyle.setIcon(symbol.icon());
319 newStyle->setLineStyle(lineStyle);
320 newStyle->setIconStyle(iconStyle);
321 style = newStyle;
322 m_styleCache.insert(cacheKey, newStyle);
323 return style;
324 }
325
326 if (parameters.relation->relationType() >= GeoDataRelation::RouteRoad && parameters.relation->relationType() <= GeoDataRelation::RouteInlineSkates) {
327 auto const colorValue = parameters.relation->osmData().tagValue(QStringLiteral("colour"));
328 QString color = colorValue;
329 if (!QColor::isValidColorName(colorValue)) {
330 switch (parameters.relation->relationType()) {
331 case GeoDataRelation::RouteTrain:
332 color = QStringLiteral("navy");
333 break;
334 case GeoDataRelation::RouteSubway:
335 color = QStringLiteral("cornflowerblue");
336 break;
337 case GeoDataRelation::RouteTram:
338 color = QStringLiteral("steelblue");
339 break;
340 case GeoDataRelation::RouteBus:
341 case GeoDataRelation::RouteTrolleyBus:
342 color = QStringLiteral("tomato");
343 break;
344 case GeoDataRelation::RouteBicycle:
345 case GeoDataRelation::RouteMountainbike:
346 case GeoDataRelation::RouteFoot:
347 case GeoDataRelation::RouteHiking:
348 case GeoDataRelation::RouteHorse:
349 case GeoDataRelation::RouteInlineSkates:
350 color = QStringLiteral("paleturquoise");
351 break;
352 case GeoDataRelation::UnknownType:
353 case GeoDataRelation::RouteRoad:
354 case GeoDataRelation::RouteDetour:
355 case GeoDataRelation::RouteFerry:
356 case GeoDataRelation::RouteSkiDownhill:
357 case GeoDataRelation::RouteSkiNordic:
358 case GeoDataRelation::RouteSkitour:
359 case GeoDataRelation::RouteSled:
360 color = QString();
361 break;
362 }
363 }
364 // Take cached Style instance if possible
365 QString const cacheKey = QStringLiteral("/route/%1/%2").arg(parameters.relation->relationType()).arg(color);
366 if (m_styleCache.contains(cacheKey)) {
367 return m_styleCache[cacheKey];
368 }
369
370 auto style = presetStyle(visualCategory);
371 auto lineStyle = style->lineStyle();
372 if (isHighway) {
373 adjustWayWidth(parameters, lineStyle);
374 }
375 GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
376 if (!color.isEmpty()) {
377 lineStyle.setColor(QColor(color));
378 auto labelStyle = style->labelStyle();
379 labelStyle.setColor(GeoDataColorStyle::contrastColor(color));
380 newStyle->setLabelStyle(labelStyle);
381 }
382 newStyle->setLineStyle(lineStyle);
383 style = newStyle;
384 m_styleCache.insert(cacheKey, newStyle);
385 return style;
386 }
387 }
388 return {};
389}
390
391GeoDataStyle::ConstPtr StyleBuilder::Private::createPlacemarkStyle(const StyleParameters &parameters)
392{
393 const GeoDataPlacemark *const placemark = parameters.placemark;
394 QString styleCacheKey;
395
396 OsmPlacemarkData const &osmData = placemark->osmData();
397 auto const visualCategory = placemark->visualCategory();
398 if (visualCategory == GeoDataPlacemark::Building) {
399 auto const tagMap = osmTagMapping();
400 auto const &osmData = placemark->osmData();
401 auto const buildingTag = QStringLiteral("building");
402 for (auto iter = osmData.tagsBegin(), end = osmData.tagsEnd(); iter != end; ++iter) {
403 auto const osmTag = StyleBuilder::OsmTag(iter.key(), iter.value());
404 if (iter.key() != buildingTag && tagMap.contains(osmTag)) {
405 return m_buildingStyles.value(tagMap.value(osmTag), m_defaultStyle[visualCategory]);
406 }
407 }
408 }
409
410 GeoDataStyle::ConstPtr style = presetStyle(visualCategory);
411
412 if (geodata_cast<GeoDataPoint>(placemark->geometry())) {
413 if (visualCategory == GeoDataPlacemark::NaturalTree) {
414 GeoDataCoordinates const coordinates = placemark->coordinate();
415 qreal const lat = coordinates.latitude(GeoDataCoordinates::Degree);
416 if (qAbs(lat) > 15) {
417 /** @todo Should maybe auto-adjust to MarbleClock at some point */
418 int const month = QDate::currentDate().month();
419 bool const southernHemisphere = lat < 0;
420 if (southernHemisphere) {
421 if (month >= 3 && month <= 5) {
422 style = m_styleTreeAutumn;
423 } else if (month >= 6 && month <= 8) {
424 style = m_styleTreeWinter;
425 }
426 } else {
427 if (month >= 9 && month <= 11) {
428 style = m_styleTreeAutumn;
429 } else if (month == 12 || month == 1 || month == 2) {
430 style = m_styleTreeWinter;
431 }
432 }
433 }
434 }
435 } else if (geodata_cast<GeoDataLinearRing>(placemark->geometry())) {
436 bool adjustStyle = false;
437
438 GeoDataPolyStyle polyStyle = style->polyStyle();
439 GeoDataLineStyle lineStyle = style->lineStyle();
440 if (visualCategory == GeoDataPlacemark::NaturalWater) {
441 if (osmData.containsTag(QStringLiteral("salt"), QStringLiteral("yes"))) {
442 polyStyle.setColor(effectColor(0xffff80));
443 lineStyle.setPenStyle(Qt::DashLine);
444 lineStyle.setWidth(2);
445 adjustStyle = true;
446 }
447 } else if (visualCategory == GeoDataPlacemark::Bathymetry) {
448 auto tagIter = osmData.findTag(QStringLiteral("ele"));
449 if (tagIter != osmData.tagsEnd()) {
450 const QString &elevation = tagIter.value();
451 if (elevation == QLatin1StringView("4000")) {
452 polyStyle.setColor(effectColor(0x94c2c2));
453 lineStyle.setColor(effectColor(0x94c2c2));
454 adjustStyle = true;
455 }
456 }
457 } else if (visualCategory == GeoDataPlacemark::AmenityGraveyard || visualCategory == GeoDataPlacemark::LanduseCemetery) {
458 auto tagIter = osmData.findTag(QStringLiteral("religion"));
459 if (tagIter != osmData.tagsEnd()) {
460 const QString &religion = tagIter.value();
461 if (religion == QLatin1StringView("jewish")) {
462 polyStyle.setTexturePath(MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_jewish.png"));
463 adjustStyle = true;
464 } else if (religion == QLatin1StringView("christian")) {
465 polyStyle.setTexturePath(MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_christian.png"));
466 adjustStyle = true;
467 } else if (religion == QLatin1StringView("INT-generic")) {
468 polyStyle.setTexturePath(MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_generic.png"));
469 adjustStyle = true;
470 }
471 }
472 } else if (visualCategory == GeoDataPlacemark::PisteDownhill) {
473 return adjustPisteStyle(parameters, style);
474 }
475
476 if (adjustStyle) {
477 GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
478 newStyle->setPolyStyle(polyStyle);
479 newStyle->setLineStyle(lineStyle);
480 style = newStyle;
481 }
482
483 if (style->iconStyle().iconPath().isEmpty()) {
484 const GeoDataPlacemark::GeoDataVisualCategory category = determineVisualCategory(osmData);
485 const GeoDataStyle::ConstPtr categoryStyle = presetStyle(category);
486 if (category != GeoDataPlacemark::None && !categoryStyle->iconStyle().scaledIcon().isNull()) {
487 GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
488 newStyle->setIconStyle(categoryStyle->iconStyle());
489 style = newStyle;
490 }
491 }
492 } else if (geodata_cast<GeoDataLineString>(placemark->geometry())) {
493 GeoDataPolyStyle polyStyle = style->polyStyle();
494 GeoDataLineStyle lineStyle = style->lineStyle();
495 GeoDataLabelStyle labelStyle = style->labelStyle();
496 GeoDataIconStyle iconStyle = style->iconStyle();
497 lineStyle.setCosmeticOutline(true);
498
499 bool adjustStyle = false;
500
501 if (visualCategory == GeoDataPlacemark::AdminLevel2) {
502 if (osmData.containsTag(QStringLiteral("maritime"), QStringLiteral("yes"))) {
503 lineStyle.setColor(effectColor(0x88b3bf));
504 polyStyle.setColor(effectColor(0x88b3bf));
505 if (osmData.containsTag(QStringLiteral("marble:disputed"), QStringLiteral("yes"))) {
506 lineStyle.setPenStyle(Qt::DashLine);
507 }
508 adjustStyle = true;
509 }
510 } else if ((visualCategory >= GeoDataPlacemark::HighwayService && visualCategory <= GeoDataPlacemark::HighwayMotorway)
511 || visualCategory == GeoDataPlacemark::TransportAirportRunway) {
512 // Take cached Style instance if possible
513 styleCacheKey = QStringLiteral("%1/%2").arg(parameters.tileLevel).arg(visualCategory);
514 if (m_styleCache.contains(styleCacheKey)) {
515 style = m_styleCache[styleCacheKey];
516 return style;
517 }
518
519 adjustStyle = true;
520 styleCacheKey = QStringLiteral("%1/%2").arg(parameters.tileLevel).arg(visualCategory);
521 adjustWayWidth(parameters, lineStyle);
522
523 QString const accessValue = osmData.tagValue(QStringLiteral("access"));
524 if (accessValue == QLatin1StringView("private") || accessValue == QLatin1StringView("no") || accessValue == QLatin1StringView("agricultural")
525 || accessValue == QLatin1StringView("delivery") || accessValue == QLatin1StringView("forestry")) {
526 QColor polyColor = polyStyle.color();
527 float hue, sat, val;
528 polyColor.getHsvF(&hue, &sat, &val);
529 polyColor.setHsvF(0.98, qMin(1.0, 0.2 + sat), val);
530 polyStyle.setColor(effectColor(polyColor));
531 lineStyle.setColor(effectColor(lineStyle.color().darker(150)));
532 }
533
534 if (osmData.containsTag("tunnel", "yes")) {
535 QColor polyColor = polyStyle.color();
536 float hue, sat, val;
537 polyColor.getHsvF(&hue, &sat, &val);
538 polyColor.setHsvF(hue, 0.25 * sat, 0.95 * val);
539 polyStyle.setColor(effectColor(polyColor));
540 lineStyle.setColor(effectColor(lineStyle.color().lighter(115)));
541 }
542
543 } else if (visualCategory >= GeoDataPlacemark::WaterwayCanal && visualCategory <= GeoDataPlacemark::WaterwayStream) {
544 adjustStyle = true;
545
546 // Take cached Style instance if possible
547 styleCacheKey = QStringLiteral("%1/%2").arg(parameters.tileLevel).arg(visualCategory);
548 if (m_styleCache.contains(styleCacheKey)) {
549 style = m_styleCache[styleCacheKey];
550 return style;
551 }
552
553 if (parameters.tileLevel <= 3) {
554 lineStyle.setWidth(1);
555 lineStyle.setPhysicalWidth(0.0);
556 styleCacheKey = QStringLiteral("%1/%2").arg(parameters.tileLevel).arg(visualCategory);
557 } else if (parameters.tileLevel <= 7) {
558 lineStyle.setWidth(2);
559 lineStyle.setPhysicalWidth(0.0);
560 styleCacheKey = QStringLiteral("%1/%2").arg(parameters.tileLevel).arg(visualCategory);
561 } else {
562 QString const widthValue = osmData.tagValue(QStringLiteral("width")).remove(QStringLiteral(" meters")).remove(QStringLiteral(" m"));
563 bool ok;
564 float const width = widthValue.toFloat(&ok);
565 lineStyle.setPhysicalWidth(ok ? qBound(0.1f, width, 200.0f) : 0.0f);
566 }
567 } else if (visualCategory == GeoDataPlacemark::PisteDownhill) {
568 return adjustPisteStyle(parameters, style);
569 }
570
571 if (adjustStyle) {
572 GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
573 newStyle->setPolyStyle(polyStyle);
574 newStyle->setLineStyle(lineStyle);
575 newStyle->setLabelStyle(labelStyle);
576 newStyle->setIconStyle(iconStyle);
577 style = newStyle;
578 if (!styleCacheKey.isEmpty()) {
579 m_styleCache.insert(styleCacheKey, newStyle);
580 }
581 }
582
583 } else if (geodata_cast<GeoDataPolygon>(placemark->geometry())) {
584 GeoDataPolyStyle polyStyle = style->polyStyle();
585 GeoDataLineStyle lineStyle = style->lineStyle();
586 bool adjustStyle = false;
587 if (visualCategory == GeoDataPlacemark::Bathymetry) {
588 auto tagIter = osmData.findTag(QStringLiteral("ele"));
589 if (tagIter != osmData.tagsEnd()) {
590 const QString &elevation = tagIter.value();
591 if (elevation == QLatin1StringView("4000")) {
592 polyStyle.setColor(effectColor(0xa5c9c9));
593 lineStyle.setColor(effectColor(0xa5c9c9));
594 adjustStyle = true;
595 }
596 }
597 } else if (visualCategory == GeoDataPlacemark::PisteDownhill) {
598 return adjustPisteStyle(parameters, style);
599 }
600
601 if (adjustStyle) {
602 GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
603 newStyle->setPolyStyle(polyStyle);
604 newStyle->setLineStyle(lineStyle);
605 style = newStyle;
606 }
607 }
608
609 return style;
610}
611
612GeoDataStyle::ConstPtr StyleBuilder::Private::adjustPisteStyle(const StyleParameters &parameters, const GeoDataStyle::ConstPtr &style)
613{
614 // Take cached Style instance if possible
615 auto const &osmData = parameters.placemark->osmData();
616 auto const visualCategory = parameters.placemark->visualCategory();
617 auto const difficulty = osmData.tagValue("piste:difficulty");
618 QString styleCacheKey = QStringLiteral("piste/%1/%2").arg(visualCategory).arg(difficulty);
619 if (m_styleCache.contains(styleCacheKey)) {
620 return m_styleCache[styleCacheKey];
621 }
622
623 GeoDataLineStyle lineStyle = style->lineStyle();
624
625 auto green = QColor(0x006600);
626 auto red = QColor(0xcc0000);
627 auto black = QColor(0x151515);
628 auto yellow = Qt::yellow;
629 auto blue = QColor(0x000099);
630 auto orange = QColor(255, 165, 0);
631 auto fallBack = Qt::lightGray;
633 if (country == QLocale::Japan) {
634 if (difficulty == "easy") {
635 lineStyle.setColor(green);
636 } else if (difficulty == "intermediate") {
637 lineStyle.setColor(red);
638 } else if (difficulty == "advanced") {
639 lineStyle.setColor(black);
640 } else {
641 lineStyle.setColor(fallBack);
642 }
643 } else if (country == QLocale::UnitedStates || country == QLocale::UnitedStatesMinorOutlyingIslands || country == QLocale::Canada
644 || m_oceanianCountries.contains(country)) {
645 if (difficulty == "easy") {
646 lineStyle.setColor(green);
647 } else if (difficulty == "intermediate") {
648 lineStyle.setColor(blue);
649 } else if (difficulty == "advanced" || difficulty == "expert") {
650 lineStyle.setColor(black);
651 } else {
652 lineStyle.setColor(fallBack);
653 }
654 // fallback on Europe
655 } else {
656 if (difficulty == "novice") {
657 lineStyle.setColor(green);
658 } else if (difficulty == "easy") {
659 lineStyle.setColor(blue);
660 } else if (difficulty == "intermediate") {
661 lineStyle.setColor(red);
662 } else if (difficulty == "advanced") {
663 lineStyle.setColor(black);
664 } else if (difficulty == "expert") {
665 // scandinavian countries have different colors then the rest of Europe
666 if (country == QLocale::Denmark || country == QLocale::Norway || country == QLocale::Sweden) {
667 lineStyle.setColor(black);
668 } else {
669 lineStyle.setColor(orange);
670 }
671 } else if (difficulty == "freeride") {
672 lineStyle.setColor(yellow);
673 } else {
674 lineStyle.setColor(fallBack);
675 }
676 }
677
678 GeoDataPolyStyle polyStyle = style->polyStyle();
679 polyStyle.setColor(effectColor(lineStyle.color()));
680 GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
681 newStyle->setPolyStyle(polyStyle);
682 newStyle->setLineStyle(lineStyle);
683 m_styleCache.insert(styleCacheKey, newStyle);
684 return newStyle;
685}
686
687void StyleBuilder::Private::adjustWayWidth(const StyleParameters &parameters, GeoDataLineStyle &lineStyle)
688{
689 auto const &osmData = parameters.placemark->osmData();
690 auto const visualCategory = parameters.placemark->visualCategory();
691 if (parameters.tileLevel <= 8) {
692 lineStyle.setPhysicalWidth(0.0);
693 lineStyle.setWidth(2.0);
694 } else if (parameters.tileLevel <= 10) {
695 lineStyle.setPhysicalWidth(0.0);
696 lineStyle.setWidth(3.0);
697 } else if (parameters.tileLevel <= 12) {
698 lineStyle.setPhysicalWidth(0.0);
699 lineStyle.setWidth(4.0);
700 } else {
701 auto tagIter = osmData.findTag(QStringLiteral("width"));
702 if (tagIter != osmData.tagsEnd()) {
703 QString const widthValue = QString(tagIter.value()).remove(QStringLiteral(" meters")).remove(QStringLiteral(" m"));
704 bool ok;
705 float const width = widthValue.toFloat(&ok);
706 lineStyle.setPhysicalWidth(ok ? qBound(0.1f, width, 200.0f) : 0.0f);
707 } else {
708 bool const isOneWay =
709 osmData.containsTag(QStringLiteral("oneway"), QStringLiteral("yes")) || osmData.containsTag(QStringLiteral("oneway"), QStringLiteral("-1"));
710 int const lanes = isOneWay ? 1 : 2; // also for motorway which implicitly is one way, but has two lanes and each direction has its own highway
711 double const laneWidth = 3.0;
712 double const margins = visualCategory == GeoDataPlacemark::HighwayMotorway ? 2.0 : (isOneWay ? 1.0 : 0.0);
713 double const physicalWidth = margins + lanes * laneWidth;
714 lineStyle.setPhysicalWidth(physicalWidth);
715 }
716 }
717}
718
719GeoDataStyle::Ptr StyleBuilder::Private::createStyle(qreal width,
720 qreal realWidth,
721 const QColor &color,
722 const QColor &outlineColor,
723 bool fill,
724 bool outline,
725 Qt::BrushStyle brushStyle,
726 Qt::PenStyle penStyle,
727 Qt::PenCapStyle capStyle,
728 bool lineBackground,
729 const QList<qreal> &dashPattern,
730 const QFont &font,
731 const QColor &fontColor,
732 const QString &texturePath)
733{
734 auto style = new GeoDataStyle;
735 GeoDataLineStyle lineStyle(effectColor(outlineColor));
736 lineStyle.setCapStyle(capStyle);
737 lineStyle.setPenStyle(penStyle);
738 lineStyle.setWidth(width);
739 lineStyle.setPhysicalWidth(realWidth);
740 lineStyle.setBackground(lineBackground);
741 lineStyle.setDashPattern(dashPattern);
742 GeoDataPolyStyle polyStyle(effectColor(color));
743 polyStyle.setOutline(outline);
744 polyStyle.setFill(fill);
745 polyStyle.setBrushStyle(brushStyle);
746 polyStyle.setTexturePath(texturePath);
747 GeoDataLabelStyle labelStyle(font, effectColor(fontColor));
748 style->setLineStyle(lineStyle);
749 style->setPolyStyle(polyStyle);
750 style->setLabelStyle(labelStyle);
751 return GeoDataStyle::Ptr(style);
752}
753
754void StyleBuilder::Private::initializeDefaultStyles()
755{
756 // We need to do this similar to the way KCmdLineOptions works in
757 // the future: Having a PlacemarkStyleProperty properties[] would
758 // help here greatly.
759
760 if (m_defaultStyleInitialized) {
761 return;
762 }
763
764 m_defaultStyleInitialized = true;
765
766 QString defaultFamily = m_defaultFont.family();
767
768#ifdef Q_OS_MACX
769 int defaultSize = 10;
770#else
771 int defaultSize = 8;
772#endif
773
774 QColor const defaultLabelColor = effectColor(m_defaultLabelColor);
775
776 m_defaultStyle[GeoDataPlacemark::None] = GeoDataStyle::Ptr(new GeoDataStyle(QString(), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
777
778 m_defaultStyle[GeoDataPlacemark::Default] =
779 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/default_location.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
780
781 m_defaultStyle[GeoDataPlacemark::Unknown] = GeoDataStyle::Ptr(new GeoDataStyle(QString(), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
782
783 m_defaultStyle[GeoDataPlacemark::SmallCity] =
784 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_4_white.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
785
786 m_defaultStyle[GeoDataPlacemark::SmallCountyCapital] =
787 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_4_yellow.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
788
789 m_defaultStyle[GeoDataPlacemark::SmallStateCapital] =
790 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_4_orange.png"), QFont(defaultFamily, defaultSize, 50, true), defaultLabelColor));
791
792 m_defaultStyle[GeoDataPlacemark::SmallNationCapital] =
793 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_4_red.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
794
795 m_defaultStyle[GeoDataPlacemark::MediumCity] =
796 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_3_white.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
797
798 m_defaultStyle[GeoDataPlacemark::MediumCountyCapital] =
799 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_3_yellow.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
800
801 m_defaultStyle[GeoDataPlacemark::MediumStateCapital] =
802 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_3_orange.png"), QFont(defaultFamily, defaultSize, 50, true), defaultLabelColor));
803
804 m_defaultStyle[GeoDataPlacemark::MediumNationCapital] =
805 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_3_red.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
806
807 m_defaultStyle[GeoDataPlacemark::BigCity] =
808 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_2_white.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
809
810 m_defaultStyle[GeoDataPlacemark::BigCountyCapital] =
811 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_2_yellow.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
812
813 m_defaultStyle[GeoDataPlacemark::BigStateCapital] =
814 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_2_orange.png"), QFont(defaultFamily, defaultSize, 50, true), defaultLabelColor));
815
816 m_defaultStyle[GeoDataPlacemark::BigNationCapital] =
817 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_2_red.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
818
819 m_defaultStyle[GeoDataPlacemark::LargeCity] =
820 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_1_white.png"), QFont(defaultFamily, defaultSize, 75, false), defaultLabelColor));
821
822 m_defaultStyle[GeoDataPlacemark::LargeCountyCapital] =
823 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_1_yellow.png"), QFont(defaultFamily, defaultSize, 75, false), defaultLabelColor));
824
825 m_defaultStyle[GeoDataPlacemark::LargeStateCapital] =
826 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_1_orange.png"), QFont(defaultFamily, defaultSize, 75, true), defaultLabelColor));
827
828 m_defaultStyle[GeoDataPlacemark::LargeNationCapital] =
829 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/city_1_red.png"), QFont(defaultFamily, defaultSize, 75, false), defaultLabelColor));
830
831 m_defaultStyle[GeoDataPlacemark::Nation] =
832 GeoDataStyle::Ptr(new GeoDataStyle(QString(), QFont(defaultFamily, int(defaultSize * 1.5), 75, false), QColor(0x404040)));
833 // Align area labels centered
834 m_defaultStyle[GeoDataPlacemark::Nation]->labelStyle().setAlignment(GeoDataLabelStyle::Center);
835
836 QFont osmCityFont = QFont(defaultFamily, int(defaultSize * 1.5), 75, false);
837 m_defaultStyle[GeoDataPlacemark::PlaceCity] = createOsmPOIStyle(osmCityFont, "place/place-6", QColor(0x202020));
838 m_defaultStyle[GeoDataPlacemark::PlaceCityCapital] = createOsmPOIStyle(osmCityFont, "place/place-capital-6", QColor(0x202020));
839 m_defaultStyle[GeoDataPlacemark::PlaceCityNationalCapital] = createOsmPOIStyle(osmCityFont, "place/place-capital-adminlevel2", QColor(0x202020));
840 m_defaultStyle[GeoDataPlacemark::PlaceSuburb] = createOsmPOIStyle(osmCityFont, QString(), QColor(0x707070));
841 m_defaultStyle[GeoDataPlacemark::PlaceHamlet] = createOsmPOIStyle(osmCityFont, QString(), QColor(0x707070));
842 QFont localityFont = osmCityFont;
843 localityFont.setPointSize(defaultSize);
844 m_defaultStyle[GeoDataPlacemark::PlaceLocality] = createOsmPOIStyle(localityFont, QString(), QColor(0x707070));
845 m_defaultStyle[GeoDataPlacemark::PlaceTown] = createOsmPOIStyle(osmCityFont, "place/place-6", QColor(0x404040));
846 m_defaultStyle[GeoDataPlacemark::PlaceTownCapital] = createOsmPOIStyle(osmCityFont, "place/place-capital-6", QColor(0x404040));
847 m_defaultStyle[GeoDataPlacemark::PlaceTownNationalCapital] = createOsmPOIStyle(osmCityFont, "place/place-capital-adminlevel2", QColor(0x404040));
848 m_defaultStyle[GeoDataPlacemark::PlaceVillage] = createOsmPOIStyle(osmCityFont, "place/place-6", QColor(0x505050));
849 m_defaultStyle[GeoDataPlacemark::PlaceVillageCapital] = createOsmPOIStyle(osmCityFont, "place/place-capital-6", QColor(0x505050));
850 m_defaultStyle[GeoDataPlacemark::PlaceVillageNationalCapital] = createOsmPOIStyle(osmCityFont, "place/place-capital-adminlevel2", QColor(0x505050));
851 for (int i = GeoDataPlacemark::PlaceCity; i <= GeoDataPlacemark::PlaceVillageCapital; ++i) {
852 m_defaultStyle[GeoDataPlacemark::GeoDataVisualCategory(i)]->polyStyle().setFill(false);
853 m_defaultStyle[GeoDataPlacemark::GeoDataVisualCategory(i)]->polyStyle().setOutline(false);
854 m_defaultStyle[GeoDataPlacemark::GeoDataVisualCategory(i)]->labelStyle().setAlignment(GeoDataLabelStyle::Center);
855
856 if (i == GeoDataPlacemark::PlaceCityNationalCapital || i == GeoDataPlacemark::PlaceTownNationalCapital
857 || i == GeoDataPlacemark::PlaceVillageNationalCapital) {
858 m_defaultStyle[GeoDataPlacemark::GeoDataVisualCategory(i)]->iconStyle().setScale(0.55f);
859 } else {
860 m_defaultStyle[GeoDataPlacemark::GeoDataVisualCategory(i)]->iconStyle().setScale(0.25);
861 }
862 }
863
864 m_defaultStyle[GeoDataPlacemark::Mountain] = GeoDataStyle::Ptr(
865 new GeoDataStyle(MarbleDirs::path("bitmaps/mountain_1.png"), QFont(defaultFamily, int(defaultSize * 0.9), 50, false), defaultLabelColor));
866
867 m_defaultStyle[GeoDataPlacemark::Volcano] = GeoDataStyle::Ptr(
868 new GeoDataStyle(MarbleDirs::path("bitmaps/volcano_1.png"), QFont(defaultFamily, int(defaultSize * 0.9), 50, false), defaultLabelColor));
869
870 m_defaultStyle[GeoDataPlacemark::Mons] = GeoDataStyle::Ptr(
871 new GeoDataStyle(MarbleDirs::path("bitmaps/mountain_1.png"), QFont(defaultFamily, int(defaultSize * 0.9), 50, false), defaultLabelColor));
872
873 m_defaultStyle[GeoDataPlacemark::Valley] =
874 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/valley.png"), QFont(defaultFamily, int(defaultSize * 0.9), 50, false), defaultLabelColor));
875
876 m_defaultStyle[GeoDataPlacemark::Continent] =
877 GeoDataStyle::Ptr(new GeoDataStyle(QString(), QFont(defaultFamily, int(defaultSize * 1.7), 50, false), QColor(0xbf0303)));
878 // Align area labels centered
879 m_defaultStyle[GeoDataPlacemark::Continent]->labelStyle().setAlignment(GeoDataLabelStyle::Center);
880
881 m_defaultStyle[GeoDataPlacemark::Ocean] =
882 GeoDataStyle::Ptr(new GeoDataStyle(QString(), QFont(defaultFamily, int(defaultSize * 1.7), 50, true), QColor(0x2c72c7)));
883 // Align area labels centered
884 m_defaultStyle[GeoDataPlacemark::Ocean]->labelStyle().setAlignment(GeoDataLabelStyle::Center);
885
886 m_defaultStyle[GeoDataPlacemark::OtherTerrain] =
887 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/other.png"), QFont(defaultFamily, int(defaultSize * 0.9), 50, false), defaultLabelColor));
888
889 m_defaultStyle[GeoDataPlacemark::Crater] =
890 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/crater.png"), QFont(defaultFamily, int(defaultSize * 0.9), 50, false), defaultLabelColor));
891
892 m_defaultStyle[GeoDataPlacemark::Mare] =
893 GeoDataStyle::Ptr(new GeoDataStyle(QString(), QFont(defaultFamily, int(defaultSize * 1.7), 50, false), QColor(0xbf0303)));
894 // Align area labels centered
895 m_defaultStyle[GeoDataPlacemark::Mare]->labelStyle().setAlignment(GeoDataLabelStyle::Center);
896
897 m_defaultStyle[GeoDataPlacemark::GeographicPole] =
898 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/pole_1.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
899
900 m_defaultStyle[GeoDataPlacemark::MagneticPole] =
901 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/pole_2.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
902
903 m_defaultStyle[GeoDataPlacemark::ShipWreck] = GeoDataStyle::Ptr(
904 new GeoDataStyle(MarbleDirs::path("bitmaps/shipwreck.png"), QFont(defaultFamily, int(defaultSize * 0.8), 50, false), defaultLabelColor));
905
906 m_defaultStyle[GeoDataPlacemark::AirPort] =
907 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/airport.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
908
909 m_defaultStyle[GeoDataPlacemark::Observatory] =
910 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/observatory.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
911
912 m_defaultStyle[GeoDataPlacemark::OsmSite] =
913 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/osm.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
914
915 m_defaultStyle[GeoDataPlacemark::Coordinate] =
916 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/coordinate.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
917
918 m_defaultStyle[GeoDataPlacemark::MannedLandingSite] =
919 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/manned_landing.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
920
921 m_defaultStyle[GeoDataPlacemark::RoboticRover] =
922 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/robotic_rover.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
923
924 m_defaultStyle[GeoDataPlacemark::UnmannedSoftLandingSite] = GeoDataStyle::Ptr(
925 new GeoDataStyle(MarbleDirs::path("bitmaps/unmanned_soft_landing.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
926
927 m_defaultStyle[GeoDataPlacemark::UnmannedHardLandingSite] = GeoDataStyle::Ptr(
928 new GeoDataStyle(MarbleDirs::path("bitmaps/unmanned_hard_landing.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
929
930 m_defaultStyle[GeoDataPlacemark::Bookmark] =
931 createPOIStyle(QFont(defaultFamily, defaultSize, 50, false), MarbleDirs::path("svg/bookmark.svg"), m_defaultLabelColor);
932 m_defaultStyle[GeoDataPlacemark::Bookmark]->iconStyle().setScale(0.75);
933
934 QColor const shopColor(0xac39ac);
935 QColor const transportationColor(0x0092da);
936 QColor const amenityColor(0x734a08);
937 QColor const healthColor(0xda0092);
938 QColor const airTransportColor(0x8461C4);
939 QColor const educationalAreasAndHospital(0xf0f0d8);
940 QColor const buildingColor(0xbeadad);
941 QColor const waterColor(0xb5d0d0);
942 // Allows to visualize multiple repaints of buildings
943 // QColor const buildingColor(0, 255, 0, 64);
944
945 QFont const osmFont(defaultFamily, 10, 50, false);
946 m_defaultStyle[GeoDataPlacemark::AccomodationCamping] = createOsmPOIRingStyle(osmFont, "transportation/camping.16", transportationColor);
947 m_defaultStyle[GeoDataPlacemark::AccomodationHostel] = createOsmPOIStyle(osmFont, "transportation/hostel.16", transportationColor);
948 m_defaultStyle[GeoDataPlacemark::AccomodationHotel] = createOsmPOIStyle(osmFont, "transportation/hotel.16", transportationColor);
949 m_defaultStyle[GeoDataPlacemark::AccomodationMotel] = createOsmPOIStyle(osmFont, "transportation/motel.16", transportationColor);
950 m_defaultStyle[GeoDataPlacemark::AccomodationYouthHostel] = createOsmPOIStyle(osmFont, "transportation/hostel.16", transportationColor);
951 m_defaultStyle[GeoDataPlacemark::AccomodationGuestHouse] = createOsmPOIStyle(osmFont, "transportation/guest_house.16", transportationColor);
952 m_defaultStyle[GeoDataPlacemark::AmenityLibrary] = createOsmPOIStyle(osmFont, "amenity/library.20", amenityColor);
953 m_defaultStyle[GeoDataPlacemark::AmenityKindergarten] = createOsmPOIAreaStyle(osmFont, QString(), amenityColor, educationalAreasAndHospital, amenityColor);
954 m_defaultStyle[GeoDataPlacemark::EducationCollege] = createOsmPOIAreaStyle(osmFont, QString(), amenityColor, educationalAreasAndHospital, amenityColor);
955 m_defaultStyle[GeoDataPlacemark::EducationSchool] = createOsmPOIAreaStyle(osmFont, QString(), amenityColor, educationalAreasAndHospital, amenityColor);
956 m_defaultStyle[GeoDataPlacemark::EducationUniversity] = createOsmPOIAreaStyle(osmFont, QString(), amenityColor, educationalAreasAndHospital, amenityColor);
957 m_defaultStyle[GeoDataPlacemark::FoodBar] = createOsmPOIStyle(osmFont, "amenity/bar.16", amenityColor);
958 m_defaultStyle[GeoDataPlacemark::FoodBiergarten] = createOsmPOIStyle(osmFont, "amenity/biergarten.16", amenityColor);
959 m_defaultStyle[GeoDataPlacemark::FoodCafe] = createOsmPOIStyle(osmFont, "amenity/cafe.16", amenityColor);
960 m_defaultStyle[GeoDataPlacemark::FoodFastFood] = createOsmPOIStyle(osmFont, "amenity/fast_food.16", amenityColor);
961 m_defaultStyle[GeoDataPlacemark::FoodPub] = createOsmPOIStyle(osmFont, "amenity/pub.16", amenityColor);
962 m_defaultStyle[GeoDataPlacemark::FoodRestaurant] = createOsmPOIStyle(osmFont, "amenity/restaurant.16", amenityColor);
963
964 m_defaultStyle[GeoDataPlacemark::HealthDentist] = createOsmPOIStyle(osmFont, "health/dentist.16", healthColor);
965 m_defaultStyle[GeoDataPlacemark::HealthDoctors] = createOsmPOIStyle(osmFont, "health/doctors.16", healthColor);
966 m_defaultStyle[GeoDataPlacemark::HealthHospital] = createOsmPOIStyle(osmFont, "health/hospital.16", healthColor, educationalAreasAndHospital, amenityColor);
967 m_defaultStyle[GeoDataPlacemark::HealthPharmacy] = createOsmPOIStyle(osmFont, "health/pharmacy.16", healthColor);
968 m_defaultStyle[GeoDataPlacemark::HealthVeterinary] = createOsmPOIStyle(osmFont, "health/veterinary-14", healthColor);
969
970 m_defaultStyle[GeoDataPlacemark::MoneyAtm] = createOsmPOIStyle(osmFont, "amenity/atm.16", amenityColor);
971 m_defaultStyle[GeoDataPlacemark::MoneyBank] = createOsmPOIStyle(osmFont, "amenity/bank.16", amenityColor);
972
973 m_defaultStyle[GeoDataPlacemark::HistoricArchaeologicalSite] =
974 createOsmPOIAreaStyle(osmFont, "amenity/archaeological_site.16", amenityColor, Qt::transparent);
975 m_defaultStyle[GeoDataPlacemark::AmenityEmbassy] = createOsmPOIStyle(osmFont, "transportation/embassy.16", transportationColor);
976 m_defaultStyle[GeoDataPlacemark::AmenityEmergencyPhone] = createOsmPOIStyle(osmFont, "amenity/emergency_phone.16", amenityColor);
977 m_defaultStyle[GeoDataPlacemark::AmenityMountainRescue] = createOsmPOIStyle(osmFont, "amenity/mountain_rescue.16", amenityColor);
978 m_defaultStyle[GeoDataPlacemark::LeisureWaterPark] = createOsmPOIStyle(osmFont, "amenity/water_park.16", amenityColor);
979 m_defaultStyle[GeoDataPlacemark::AmenityCommunityCentre] = createOsmPOIStyle(osmFont, "amenity/community_centre-14", amenityColor);
980 m_defaultStyle[GeoDataPlacemark::AmenityFountain] = createOsmPOIStyle(osmFont, "amenity/fountain-14", QColor(0x7989de), waterColor, waterColor.darker(150));
981 m_defaultStyle[GeoDataPlacemark::AmenityNightClub] = createOsmPOIStyle(osmFont, "amenity/nightclub.18", amenityColor);
982 m_defaultStyle[GeoDataPlacemark::AmenityBench] = createOsmPOIStyle(osmFont, "individual/bench.16", amenityColor);
983 m_defaultStyle[GeoDataPlacemark::AmenityCourtHouse] = createOsmPOIStyle(osmFont, "amenity/courthouse-16", amenityColor);
984 m_defaultStyle[GeoDataPlacemark::AmenityFireStation] = createOsmPOIStyle(osmFont, "amenity/firestation.16", amenityColor);
985 m_defaultStyle[GeoDataPlacemark::AmenityHuntingStand] = createOsmPOIStyle(osmFont, "manmade/hunting-stand.16", amenityColor);
986 m_defaultStyle[GeoDataPlacemark::AmenityPolice] = createOsmPOIStyle(osmFont, "amenity/police.16", amenityColor);
987 m_defaultStyle[GeoDataPlacemark::AmenityPostBox] = createOsmPOIStyle(osmFont, "amenity/post_box-12", amenityColor);
988 m_defaultStyle[GeoDataPlacemark::AmenityPostOffice] = createOsmPOIStyle(osmFont, "amenity/post_office-14", amenityColor);
989 m_defaultStyle[GeoDataPlacemark::AmenityPrison] = createOsmPOIStyle(osmFont, "amenity/prison.16", amenityColor);
990 m_defaultStyle[GeoDataPlacemark::AmenityRecycling] = createOsmPOIStyle(osmFont, "amenity/recycling.16", amenityColor);
991 m_defaultStyle[GeoDataPlacemark::AmenityShelter] = createOsmPOIStyle(osmFont, "transportation/shelter", transportationColor);
992 m_defaultStyle[GeoDataPlacemark::AmenityTelephone] = createOsmPOIStyle(osmFont, "amenity/telephone.16", amenityColor);
993 m_defaultStyle[GeoDataPlacemark::AmenityToilets] = createOsmPOIStyle(osmFont, "amenity/toilets.16", amenityColor);
994 m_defaultStyle[GeoDataPlacemark::AmenityTownHall] = createOsmPOIStyle(osmFont, "amenity/town_hall.16", amenityColor);
995 m_defaultStyle[GeoDataPlacemark::AmenityWasteBasket] = createOsmPOIStyle(osmFont, "individual/waste_basket.10", amenityColor);
996 m_defaultStyle[GeoDataPlacemark::AmenityWasteBasket]->iconStyle().setScale(0.75);
997 m_defaultStyle[GeoDataPlacemark::AmenityChargingStation] = createOsmPOIStyle(osmFont, "transportation/charging_station");
998 m_defaultStyle[GeoDataPlacemark::AmenityCarWash] = createOsmPOIStyle(osmFont, "amenity/car_wash", amenityColor);
999 m_defaultStyle[GeoDataPlacemark::AmenitySocialFacility] = createOsmPOIStyle(osmFont, "amenity/social_facility", amenityColor);
1000
1001 m_defaultStyle[GeoDataPlacemark::AmenityDrinkingWater] = createOsmPOIStyle(osmFont, "amenity/drinking_water.16", amenityColor);
1002
1003 m_defaultStyle[GeoDataPlacemark::NaturalPeak] = createOsmPOIStyle(osmFont, "individual/peak", amenityColor);
1004 m_defaultStyle[GeoDataPlacemark::NaturalPeak]->iconStyle().setScale(0.33f);
1005 m_defaultStyle[GeoDataPlacemark::NaturalVolcano] = createOsmPOIStyle(osmFont, "individual/volcano", amenityColor);
1006 m_defaultStyle[GeoDataPlacemark::NaturalVolcano]->iconStyle().setScale(0.33f);
1007 m_defaultStyle[GeoDataPlacemark::NaturalTree] = createOsmPOIStyle(osmFont, "individual/tree-29", amenityColor); // tree-16 provides the official icon
1008 m_styleTreeAutumn = createOsmPOIStyle(osmFont, "individual/tree-29-autumn", amenityColor);
1009 m_styleTreeWinter = createOsmPOIStyle(osmFont, "individual/tree-29-winter", amenityColor);
1010 qreal const treeIconScale = 0.75;
1011 m_defaultStyle[GeoDataPlacemark::NaturalTree]->iconStyle().setScale(treeIconScale);
1012 m_styleTreeAutumn->iconStyle().setScale(treeIconScale);
1013 m_styleTreeWinter->iconStyle().setScale(treeIconScale);
1014
1015 m_defaultStyle[GeoDataPlacemark::ShopBeverages] = createOsmPOIStyle(osmFont, "shop/beverages-14", shopColor);
1016 m_defaultStyle[GeoDataPlacemark::ShopHifi] = createOsmPOIStyle(osmFont, "shop/hifi-14", shopColor);
1017 m_defaultStyle[GeoDataPlacemark::ShopSupermarket] = createOsmPOIStyle(osmFont, "shop/shop_supermarket", shopColor);
1018 m_defaultStyle[GeoDataPlacemark::ShopAlcohol] = createOsmPOIStyle(osmFont, "shop/shop_alcohol.16", shopColor);
1019 m_defaultStyle[GeoDataPlacemark::ShopBakery] = createOsmPOIStyle(osmFont, "shop/shop_bakery.16", shopColor);
1020 m_defaultStyle[GeoDataPlacemark::ShopButcher] = createOsmPOIStyle(osmFont, "shop/butcher-14", shopColor);
1021 m_defaultStyle[GeoDataPlacemark::ShopConfectionery] = createOsmPOIStyle(osmFont, "shop/confectionery.14", shopColor);
1022 m_defaultStyle[GeoDataPlacemark::ShopConvenience] = createOsmPOIStyle(osmFont, "shop/shop_convenience", shopColor);
1023 m_defaultStyle[GeoDataPlacemark::ShopGreengrocer] = createOsmPOIStyle(osmFont, "shop/greengrocer-14", shopColor);
1024 m_defaultStyle[GeoDataPlacemark::ShopSeafood] = createOsmPOIStyle(osmFont, "shop/seafood-14", shopColor);
1025 m_defaultStyle[GeoDataPlacemark::ShopDepartmentStore] = createOsmPOIStyle(osmFont, "shop/department_store-16", shopColor);
1026 m_defaultStyle[GeoDataPlacemark::ShopKiosk] = createOsmPOIStyle(osmFont, "shop/kiosk-14", shopColor);
1027 m_defaultStyle[GeoDataPlacemark::ShopBag] = createOsmPOIStyle(osmFont, "shop/bag-14", shopColor);
1028 m_defaultStyle[GeoDataPlacemark::ShopClothes] = createOsmPOIStyle(osmFont, "shop/shop_clothes.16", shopColor);
1029 m_defaultStyle[GeoDataPlacemark::ShopFashion] = createOsmPOIStyle(osmFont, "shop/shop_clothes.16", shopColor);
1030 m_defaultStyle[GeoDataPlacemark::ShopJewelry] = createOsmPOIStyle(osmFont, "shop/shop_jewelry.16", shopColor);
1031 m_defaultStyle[GeoDataPlacemark::ShopShoes] = createOsmPOIStyle(osmFont, "shop/shop_shoes.16", shopColor);
1032 m_defaultStyle[GeoDataPlacemark::ShopVarietyStore] = createOsmPOIStyle(osmFont, "shop/variety_store-14", shopColor);
1033 m_defaultStyle[GeoDataPlacemark::ShopBeauty] = createOsmPOIStyle(osmFont, "shop/beauty-14", shopColor);
1034 m_defaultStyle[GeoDataPlacemark::ShopChemist] = createOsmPOIStyle(osmFont, "shop/chemist-14", shopColor);
1035 m_defaultStyle[GeoDataPlacemark::ShopCosmetics] = createOsmPOIStyle(osmFont, "shop/perfumery-14", shopColor);
1036 m_defaultStyle[GeoDataPlacemark::ShopHairdresser] = createOsmPOIStyle(osmFont, "shop/shop_hairdresser.16", shopColor);
1037 m_defaultStyle[GeoDataPlacemark::ShopOptician] = createOsmPOIStyle(osmFont, "shop/shop_optician.16", shopColor);
1038 m_defaultStyle[GeoDataPlacemark::ShopPerfumery] = createOsmPOIStyle(osmFont, "shop/perfumery-14", shopColor);
1039 m_defaultStyle[GeoDataPlacemark::ShopDoitYourself] = createOsmPOIStyle(osmFont, "shop/shop_diy.16", shopColor);
1040 m_defaultStyle[GeoDataPlacemark::ShopFlorist] = createOsmPOIStyle(osmFont, "shop/florist.16", shopColor);
1041 m_defaultStyle[GeoDataPlacemark::ShopHardware] = createOsmPOIStyle(osmFont, "shop/shop_diy.16", shopColor);
1042 m_defaultStyle[GeoDataPlacemark::ShopFurniture] = createOsmPOIStyle(osmFont, "shop/shop_furniture.16", shopColor);
1043 m_defaultStyle[GeoDataPlacemark::ShopElectronics] = createOsmPOIStyle(osmFont, "shop/shop_electronics.16", shopColor);
1044 m_defaultStyle[GeoDataPlacemark::ShopMobilePhone] = createOsmPOIStyle(osmFont, "shop/shop_mobile_phone.16", shopColor);
1045 m_defaultStyle[GeoDataPlacemark::ShopBicycle] = createOsmPOIStyle(osmFont, "shop/shop_bicycle.16", shopColor);
1046 m_defaultStyle[GeoDataPlacemark::ShopCar] = createOsmPOIStyle(osmFont, "shop/shop_car", shopColor);
1047 m_defaultStyle[GeoDataPlacemark::ShopCarRepair] = createOsmPOIStyle(osmFont, "shop/shopping_car_repair.16", shopColor);
1048 m_defaultStyle[GeoDataPlacemark::ShopCarParts] = createOsmPOIStyle(osmFont, "shop/car_parts-14", shopColor);
1049 m_defaultStyle[GeoDataPlacemark::ShopMotorcycle] = createOsmPOIStyle(osmFont, "shop/motorcycle-14", shopColor);
1050 m_defaultStyle[GeoDataPlacemark::ShopOutdoor] = createOsmPOIStyle(osmFont, "shop/outdoor-14", shopColor);
1051 m_defaultStyle[GeoDataPlacemark::ShopSports] = createOsmPOIStyle(osmFont, "shop/sports", shopColor);
1052 m_defaultStyle[GeoDataPlacemark::ShopCopy] = createOsmPOIStyle(osmFont, "shop/copyshop", shopColor);
1053 m_defaultStyle[GeoDataPlacemark::ShopArt] = createOsmPOIStyle(osmFont, "shop/art", shopColor);
1054 m_defaultStyle[GeoDataPlacemark::ShopMusicalInstrument] = createOsmPOIStyle(osmFont, "shop/musical_instrument-14", shopColor);
1055 m_defaultStyle[GeoDataPlacemark::ShopPhoto] = createOsmPOIStyle(osmFont, "shop/photo-14", shopColor);
1056 m_defaultStyle[GeoDataPlacemark::ShopBook] = createOsmPOIStyle(osmFont, "shop/shop_books.16", shopColor);
1057 m_defaultStyle[GeoDataPlacemark::ShopGift] = createOsmPOIStyle(osmFont, "shop/shop_gift.16", shopColor);
1058 m_defaultStyle[GeoDataPlacemark::ShopStationery] = createOsmPOIStyle(osmFont, "shop/stationery-14", shopColor);
1059 m_defaultStyle[GeoDataPlacemark::ShopLaundry] = createOsmPOIStyle(osmFont, "shop/laundry-14", shopColor);
1060 m_defaultStyle[GeoDataPlacemark::ShopPet] = createOsmPOIStyle(osmFont, "shop/shop_pet.16", shopColor);
1061 m_defaultStyle[GeoDataPlacemark::ShopToys] = createOsmPOIStyle(osmFont, "shop/toys-14", shopColor);
1062 m_defaultStyle[GeoDataPlacemark::ShopTravelAgency] = createOsmPOIStyle(osmFont, "shop/travel_agency-14", shopColor);
1063 m_defaultStyle[GeoDataPlacemark::ShopDeli] = createOsmPOIStyle(osmFont, "shop/deli", shopColor);
1064 m_defaultStyle[GeoDataPlacemark::ShopTobacco] = createOsmPOIStyle(osmFont, "shop/tobacco", shopColor);
1065 m_defaultStyle[GeoDataPlacemark::ShopTea] = createOsmPOIStyle(osmFont, "shop/tea", shopColor);
1066 m_defaultStyle[GeoDataPlacemark::ShopComputer] = createOsmPOIStyle(osmFont, "shop/computer-14", shopColor);
1067 m_defaultStyle[GeoDataPlacemark::ShopGardenCentre] = createOsmPOIStyle(osmFont, "shop/garden_centre-14", shopColor);
1068 m_defaultStyle[GeoDataPlacemark::Shop] = createOsmPOIStyle(osmFont, "shop/shop-14", shopColor);
1069
1070 m_defaultStyle[GeoDataPlacemark::ManmadeBridge] = createWayStyle(QColor(0xb8b8b8), Qt::transparent, true, true);
1071 m_defaultStyle[GeoDataPlacemark::ManmadeLighthouse] =
1072 createOsmPOIStyle(osmFont, "transportation/lighthouse.16", transportationColor, 0xf2efe9, QColor(0xf2efe9).darker());
1073 m_defaultStyle[GeoDataPlacemark::ManmadePier] =
1074 createStyle(0.0, 3.0, 0xf2efe9, 0xf2efe9, true, false, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false, QList<qreal>(), osmFont);
1075 m_defaultStyle[GeoDataPlacemark::ManmadeWaterTower] = createOsmPOIStyle(osmFont, "amenity/water_tower.16", amenityColor);
1076 m_defaultStyle[GeoDataPlacemark::ManmadeWindMill] = createOsmPOIStyle(osmFont, "amenity/windmill.16", amenityColor);
1077 m_defaultStyle[GeoDataPlacemark::ManmadeCommunicationsTower] = createOsmPOIStyle(osmFont, "manmade/communications.16", amenityColor);
1078
1079 m_defaultStyle[GeoDataPlacemark::HistoricCastle] = createOsmPOIRingStyle(osmFont, "amenity/cinema.16", amenityColor);
1080 m_defaultStyle[GeoDataPlacemark::HistoricMemorial] = createOsmPOIStyle(osmFont, "amenity/tourist_memorial.16", amenityColor);
1081 m_defaultStyle[GeoDataPlacemark::HistoricMonument] = createOsmPOIStyle(osmFont, "amenity/monument.16", amenityColor);
1082 m_defaultStyle[GeoDataPlacemark::HistoricRuins] = createOsmPOIRingStyle(osmFont, QString(), amenityColor);
1083
1084 m_defaultStyle[GeoDataPlacemark::TourismAttraction] = createOsmPOIStyle(osmFont, "amenity/tourist_memorial.16", amenityColor);
1085 m_defaultStyle[GeoDataPlacemark::TourismArtwork] = createOsmPOIStyle(osmFont, "amenity/artwork", amenityColor);
1086 m_defaultStyle[GeoDataPlacemark::AmenityCinema] = createOsmPOIStyle(osmFont, "amenity/cinema.16", amenityColor);
1087 m_defaultStyle[GeoDataPlacemark::TourismInformation] = createOsmPOIStyle(osmFont, "amenity/information.16", amenityColor);
1088 m_defaultStyle[GeoDataPlacemark::TourismMuseum] = createOsmPOIStyle(osmFont, "amenity/museum.16", amenityColor);
1089 m_defaultStyle[GeoDataPlacemark::AmenityTheatre] = createOsmPOIStyle(osmFont, "amenity/theatre.16", amenityColor);
1090 m_defaultStyle[GeoDataPlacemark::TourismThemePark] = createOsmPOIStyle(osmFont, QString(), amenityColor);
1091 m_defaultStyle[GeoDataPlacemark::TourismViewPoint] = createOsmPOIStyle(osmFont, "amenity/viewpoint.16", amenityColor);
1092 m_defaultStyle[GeoDataPlacemark::TourismZoo] = createOsmPOIRingStyle(osmFont, QString(), amenityColor, Qt::transparent);
1093 m_defaultStyle[GeoDataPlacemark::TourismAlpineHut] = createOsmPOIStyle(osmFont, "transportation/alpinehut.16", transportationColor);
1094 m_defaultStyle[GeoDataPlacemark::TourismWildernessHut] = createOsmPOIStyle(osmFont, "transportation/wilderness_hut", transportationColor);
1095 m_defaultStyle[GeoDataPlacemark::TransportAerodrome] = createOsmPOIStyle(osmFont, "airtransport/aerodrome", airTransportColor);
1096 m_defaultStyle[GeoDataPlacemark::TransportHelipad] = createOsmPOIStyle(osmFont, "airtransport/helipad", airTransportColor);
1097 m_defaultStyle[GeoDataPlacemark::TransportAirportTerminal] = createOsmPOIAreaStyle(osmFont, QString(), airTransportColor);
1098 m_defaultStyle[GeoDataPlacemark::TransportAirportGate] = createOsmPOIAreaStyle(osmFont, QString(), airTransportColor);
1099 m_defaultStyle[GeoDataPlacemark::TransportBusStation] = createOsmPOIStyle(osmFont, "transportation/bus_station.16", transportationColor);
1100 m_defaultStyle[GeoDataPlacemark::TransportBusStop] = createOsmPOIStyle(osmFont, "transportation/bus_stop.12", transportationColor);
1101 m_defaultStyle[GeoDataPlacemark::TransportCarShare] = createOsmPOIStyle(osmFont, "transportation/car_share.16", transportationColor);
1102 m_defaultStyle[GeoDataPlacemark::TransportFuel] = createOsmPOIStyle(osmFont, "transportation/fuel.16", transportationColor);
1103 m_defaultStyle[GeoDataPlacemark::TransportParking] =
1104 createOsmPOIAreaStyle(osmFont, "transportation/parking", transportationColor, 0xF6EEB6, QColor(0xF6EEB6).darker());
1105 m_defaultStyle[GeoDataPlacemark::TransportBicycleParking] = createOsmPOIAreaStyle(osmFont, "transportation/bicycle_parking.16", transportationColor);
1106 m_defaultStyle[GeoDataPlacemark::TransportMotorcycleParking] = createOsmPOIAreaStyle(osmFont, "transportation/motorcycle_parking.16", transportationColor);
1107 qreal const parkingIconScale = 0.75;
1108 m_defaultStyle[GeoDataPlacemark::TransportParking]->iconStyle().setScale(parkingIconScale);
1109 m_defaultStyle[GeoDataPlacemark::TransportBicycleParking]->iconStyle().setScale(parkingIconScale);
1110 m_defaultStyle[GeoDataPlacemark::TransportMotorcycleParking]->iconStyle().setScale(parkingIconScale);
1111 m_defaultStyle[GeoDataPlacemark::TransportParkingSpace] = createWayStyle(0xF6EEB6, QColor(0xF6EEB6).darker(), true, true);
1112 m_defaultStyle[GeoDataPlacemark::TransportPlatform] = createWayStyle(0xbbbbbb, Qt::transparent, true, false);
1113 m_defaultStyle[GeoDataPlacemark::TransportTrainStation] = createOsmPOIStyle(osmFont, "individual/railway_station", transportationColor);
1114 m_defaultStyle[GeoDataPlacemark::TransportTrainStation]->iconStyle().setScale(0.5);
1115 m_defaultStyle[GeoDataPlacemark::TransportTramStop] = createOsmPOIStyle(osmFont, "individual/railway_station", transportationColor);
1116 m_defaultStyle[GeoDataPlacemark::TransportTramStop]->iconStyle().setScale(0.33f);
1117 m_defaultStyle[GeoDataPlacemark::TransportRentalBicycle] = createOsmPOIStyle(osmFont, "transportation/rental_bicycle.16", transportationColor);
1118 m_defaultStyle[GeoDataPlacemark::TransportRentalCar] = createOsmPOIStyle(osmFont, "transportation/rental_car.16", transportationColor);
1119 m_defaultStyle[GeoDataPlacemark::TransportRentalSki] = createOsmPOIStyle(osmFont, "transportation/rental_ski.16", transportationColor);
1120 m_defaultStyle[GeoDataPlacemark::TransportTaxiRank] = createOsmPOIStyle(osmFont, "transportation/taxi.16", transportationColor);
1121 m_defaultStyle[GeoDataPlacemark::TransportSubwayEntrance] = createOsmPOIStyle(osmFont, "transportation/subway_entrance", transportationColor);
1122 m_defaultStyle[GeoDataPlacemark::ReligionPlaceOfWorship] = createOsmPOIStyle(osmFont, "black/place_of_worship.16");
1123 m_defaultStyle[GeoDataPlacemark::ReligionBahai] = createOsmPOIStyle(osmFont, QString());
1124 m_defaultStyle[GeoDataPlacemark::ReligionBuddhist] = createOsmPOIStyle(osmFont, "black/buddhist.16");
1125 m_defaultStyle[GeoDataPlacemark::ReligionChristian] = createOsmPOIStyle(osmFont, "black/christian.16");
1126 m_defaultStyle[GeoDataPlacemark::ReligionMuslim] = createOsmPOIStyle(osmFont, "black/muslim.16");
1127 m_defaultStyle[GeoDataPlacemark::ReligionHindu] = createOsmPOIStyle(osmFont, "black/hinduist.16");
1128 m_defaultStyle[GeoDataPlacemark::ReligionJain] = createOsmPOIStyle(osmFont, QString());
1129 m_defaultStyle[GeoDataPlacemark::ReligionJewish] = createOsmPOIStyle(osmFont, "black/jewish.16");
1130 m_defaultStyle[GeoDataPlacemark::ReligionShinto] = createOsmPOIStyle(osmFont, "black/shintoist.16");
1131 m_defaultStyle[GeoDataPlacemark::ReligionSikh] = createOsmPOIStyle(osmFont, "black/sikhist.16");
1132 m_defaultStyle[GeoDataPlacemark::ReligionTaoist] = createOsmPOIStyle(osmFont, "black/taoist.16");
1133
1134 m_defaultStyle[GeoDataPlacemark::IndoorDoor] = createOsmPOIRingStyle(osmFont, "indoor/door_b.16");
1135 m_defaultStyle[GeoDataPlacemark::IndoorWall] = createOsmPOIStyle(osmFont, QString());
1136 m_defaultStyle[GeoDataPlacemark::IndoorRoom] = createWayStyle(buildingColor.darker(), QColor(Qt::black));
1137
1138 m_defaultStyle[GeoDataPlacemark::HighwayTrafficSignals] = createOsmPOIStyle(osmFont, "individual/traffic_light");
1139 m_defaultStyle[GeoDataPlacemark::HighwayTrafficSignals]->iconStyle().setScale(0.75);
1140
1141 m_defaultStyle[GeoDataPlacemark::HighwayElevator] = createOsmPOIStyle(osmFont, "transportation/elevator-12", transportationColor);
1142 m_defaultStyle[GeoDataPlacemark::HighwayElevator]->iconStyle().setScale(0.75);
1143
1144 m_defaultStyle[GeoDataPlacemark::PowerTower] = createOsmPOIStyle(osmFont, "individual/power_tower", QColor(0x888888));
1145 m_defaultStyle[GeoDataPlacemark::PowerTower]->iconStyle().setScale(0.6f);
1146
1147 m_defaultStyle[GeoDataPlacemark::BarrierCityWall] = createStyle(6.0,
1148 3.0,
1149 0x787878,
1151 true,
1152 false,
1156 false,
1157 QList<qreal>(),
1158 osmFont,
1160 m_defaultStyle[GeoDataPlacemark::BarrierGate] = createOsmPOIStyle(osmFont, "individual/gate");
1161 m_defaultStyle[GeoDataPlacemark::BarrierGate]->iconStyle().setScale(0.75);
1162 m_defaultStyle[GeoDataPlacemark::BarrierLiftGate] = createOsmPOIStyle(osmFont, "individual/liftgate");
1163 m_defaultStyle[GeoDataPlacemark::BarrierLiftGate]->iconStyle().setScale(0.75);
1164 m_defaultStyle[GeoDataPlacemark::BarrierWall] = createStyle(2.0,
1165 0.0,
1166 0x787878,
1168 true,
1169 false,
1173 false,
1174 QList<qreal>(),
1175 osmFont,
1177
1178 m_defaultStyle[GeoDataPlacemark::HighwaySteps] = createStyle(0.0,
1179 2.0,
1180 0xfa8072,
1182 true,
1183 true,
1187 false,
1188 QList<qreal>() << 0.3 << 0.3,
1189 osmFont);
1190 m_defaultStyle[GeoDataPlacemark::HighwayUnknown] = createHighwayStyle(0xdddddd, 0xbbbbbb, osmFont, "000000", 0, 1);
1191 m_defaultStyle[GeoDataPlacemark::HighwayPath] = createHighwayStyle(0xdddde8, 0x999999, osmFont, "000000", 0, 1, Qt::DotLine, Qt::SquareCap, true);
1192 m_defaultStyle[GeoDataPlacemark::HighwayTrack] =
1193 createHighwayStyle(0x996600, QColor(Qt::white), osmFont, QColor(Qt::transparent), 1, 1, Qt::DashLine, Qt::SquareCap, true);
1194 m_defaultStyle[GeoDataPlacemark::HighwayPedestrian] = createHighwayStyle(0xdddde8, 0x999999, osmFont, "000000", 0, 2);
1195 m_defaultStyle[GeoDataPlacemark::HighwayPedestrian]->polyStyle().setOutline(false);
1196 m_defaultStyle[GeoDataPlacemark::HighwayFootway] =
1197 createHighwayStyle(0xfa8072, QColor(Qt::white), osmFont, "000000", 0, 2, Qt::DotLine, Qt::SquareCap, true);
1198 m_defaultStyle[GeoDataPlacemark::HighwayCycleway] =
1199 createHighwayStyle(QColor(Qt::blue), QColor(Qt::white), osmFont, "000000", 0, 2, Qt::DotLine, Qt::SquareCap, true);
1200 m_defaultStyle[GeoDataPlacemark::HighwayService] = createHighwayStyle(0xffffff, 0xbbbbbb, osmFont, "000000", 1, 6);
1201 m_defaultStyle[GeoDataPlacemark::HighwayResidential] = createHighwayStyle(0xffffff, 0xbbbbbb, osmFont, "000000", 3, 6);
1202 m_defaultStyle[GeoDataPlacemark::HighwayLivingStreet] = createHighwayStyle(0xffffff, 0xbbbbbb, osmFont, "000000", 3, 6);
1203 m_defaultStyle[GeoDataPlacemark::HighwayRoad] = createHighwayStyle(0xdddddd, 0xbbbbbb, osmFont, "000000", 3, 6);
1204 m_defaultStyle[GeoDataPlacemark::HighwayUnclassified] = createHighwayStyle(0xffffff, 0xbbbbbb, osmFont, "000000", 3, 6);
1205 m_defaultStyle[GeoDataPlacemark::HighwayTertiary] = createHighwayStyle(0xffffff, 0x8f8f8f, osmFont, "000000", 6, 6);
1206 m_defaultStyle[GeoDataPlacemark::HighwayTertiaryLink] = createHighwayStyle(0xffffff, 0x8f8f8f, osmFont, "000000", 6, 6);
1207 m_defaultStyle[GeoDataPlacemark::HighwaySecondary] = createHighwayStyle(0xf7fabf, 0x707d05, osmFont, "000000", 6, 6);
1208 m_defaultStyle[GeoDataPlacemark::HighwaySecondaryLink] = createHighwayStyle(0xf7fabf, 0x707d05, osmFont, "000000", 6, 6);
1209 m_defaultStyle[GeoDataPlacemark::HighwayPrimary] = createHighwayStyle(0xfcd6a4, 0xa06b00, osmFont, "000000", 9, 6);
1210 m_defaultStyle[GeoDataPlacemark::HighwayPrimaryLink] = createHighwayStyle(0xfcd6a4, 0xa06b00, osmFont, "000000", 6, 6);
1211 m_defaultStyle[GeoDataPlacemark::HighwayRaceway] = createHighwayStyle(0xffc0cb, 0xffc0cb, osmFont, "000000", 1, 5);
1212 m_defaultStyle[GeoDataPlacemark::HighwayTrunk] = createHighwayStyle(0xf9b29c, 0xc84e2f, osmFont, "000000", 9, 6);
1213 m_defaultStyle[GeoDataPlacemark::HighwayTrunkLink] = createHighwayStyle(0xf9b29c, 0xc84e2f, osmFont, "000000", 9, 6);
1214 m_defaultStyle[GeoDataPlacemark::HighwayMotorway] = createHighwayStyle(0xe892a2, 0xdc2a67, osmFont, "000000", 9, 10);
1215 m_defaultStyle[GeoDataPlacemark::HighwayMotorwayLink] = createHighwayStyle(0xe892a2, 0xdc2a67, osmFont, "000000", 9, 10);
1216 m_defaultStyle[GeoDataPlacemark::HighwayCorridor] = createHighwayStyle(0xffffff, 0xbbbbbb, osmFont, "000000", 1, 3);
1217 m_defaultStyle[GeoDataPlacemark::TransportAirportRunway] = createHighwayStyle(0xbbbbcc, 0xbbbbcc, osmFont, "000000", 0, 1, Qt::NoPen);
1218 m_defaultStyle[GeoDataPlacemark::TransportAirportTaxiway] = createHighwayStyle(0xbbbbcc, 0xbbbbcc, osmFont, "000000", 0, 1, Qt::NoPen);
1219 m_defaultStyle[GeoDataPlacemark::TransportAirportApron] = createWayStyle(0xe9d1ff, Qt::transparent, true, false);
1220 m_defaultStyle[GeoDataPlacemark::TransportSpeedCamera] = createOsmPOIStyle(osmFont, "individual/speedcamera");
1221
1222 m_defaultStyle[GeoDataPlacemark::NaturalWater] = createStyle(4,
1223 0,
1224 waterColor,
1225 waterColor,
1226 true,
1227 false,
1231 false,
1232 QList<qreal>(),
1233 osmFont,
1234 waterColor.darker(150));
1235 m_defaultStyle[GeoDataPlacemark::WaterwayRiver] = createStyle(4,
1236 0,
1237 waterColor,
1238 waterColor,
1239 true,
1240 false,
1244 false,
1245 QList<qreal>(),
1246 osmFont,
1247 waterColor.darker(150));
1248 m_defaultStyle[GeoDataPlacemark::WaterwayCanal] = m_defaultStyle[GeoDataPlacemark::WaterwayRiver];
1249 m_defaultStyle[GeoDataPlacemark::WaterwayDitch] = m_defaultStyle[GeoDataPlacemark::WaterwayRiver];
1250 m_defaultStyle[GeoDataPlacemark::WaterwayDrain] = m_defaultStyle[GeoDataPlacemark::WaterwayRiver];
1251 m_defaultStyle[GeoDataPlacemark::WaterwayStream] = m_defaultStyle[GeoDataPlacemark::WaterwayRiver];
1252 m_defaultStyle[GeoDataPlacemark::WaterwayWeir] =
1253 createStyle(4, 0, 0xffffff, 0x87939b, true, false, Qt::SolidPattern, Qt::DotLine, Qt::RoundCap, true, QList<qreal>(), osmFont, waterColor.darker(150));
1254
1255 m_defaultStyle[GeoDataPlacemark::CrossingIsland] = createOsmPOIStyle(osmFont, "transportation/zebra_crossing", transportationColor);
1256 m_defaultStyle[GeoDataPlacemark::CrossingIsland]->iconStyle().setScale(0.75);
1257 m_defaultStyle[GeoDataPlacemark::CrossingRailway] = createOsmPOIStyle(osmFont, "transportation/railway_crossing", transportationColor);
1258 m_defaultStyle[GeoDataPlacemark::CrossingRailway]->iconStyle().setScale(0.5);
1259 m_defaultStyle[GeoDataPlacemark::CrossingSignals] = createOsmPOIStyle(osmFont, "transportation/traffic_light_crossing", transportationColor);
1260 m_defaultStyle[GeoDataPlacemark::CrossingSignals]->iconStyle().setScale(0.75);
1261 m_defaultStyle[GeoDataPlacemark::CrossingZebra] = createOsmPOIStyle(osmFont, "transportation/zebra_crossing", transportationColor);
1262 m_defaultStyle[GeoDataPlacemark::CrossingZebra]->iconStyle().setScale(0.75);
1263
1264 m_defaultStyle[GeoDataPlacemark::NaturalReef] = createStyle(5.5,
1265 0,
1266 0x36677c,
1267 0x36677c,
1268 true,
1269 false,
1273 false,
1274 QList<qreal>(),
1275 osmFont,
1276 waterColor.darker(150));
1277
1278 m_defaultStyle[GeoDataPlacemark::AmenityGraveyard] =
1279 createWayStyle(0xAACBAF, 0xAACBAF, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_generic.png"));
1280
1281 m_defaultStyle[GeoDataPlacemark::NaturalWood] =
1282 createWayStyle(0x8DC46C, 0x8DC46C, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/forest.png"));
1283 m_defaultStyle[GeoDataPlacemark::NaturalBeach] =
1284 createWayStyle(0xFFF1BA, 0xFFF1BA, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/beach.png"));
1285 m_defaultStyle[GeoDataPlacemark::NaturalWetland] =
1286 createWayStyle(0xDDECEC, 0xDDECEC, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/wetland.png"));
1287 m_defaultStyle[GeoDataPlacemark::NaturalGlacier] =
1288 createWayStyle(0xDDECEC, 0xDDECEC, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/glacier.png"));
1289 m_defaultStyle[GeoDataPlacemark::NaturalIceShelf] =
1290 createWayStyle(0x8ebebe, 0x8ebebe, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/glacier.png"));
1291 m_defaultStyle[GeoDataPlacemark::NaturalScrub] =
1292 createWayStyle(0xB5E3B5, 0xB5E3B5, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/scrub.png"));
1293 m_defaultStyle[GeoDataPlacemark::NaturalCliff] =
1294 createWayStyle(Qt::transparent, Qt::transparent, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/cliff2.png"));
1295 m_defaultStyle[GeoDataPlacemark::NaturalCave] = createOsmPOIStyle(osmFont, "amenities/cave", amenityColor);
1296 m_defaultStyle[GeoDataPlacemark::NaturalHeath] = createWayStyle(0xd6d99f, QColor(0xd6d99f).darker(150), true, false);
1297
1298 m_defaultStyle[GeoDataPlacemark::LeisureGolfCourse] = createOsmPOIAreaStyle(osmFont, "leisure/golf", 0x39ac39, 0xb5e3b5, QColor(Qt::transparent));
1299 m_defaultStyle[GeoDataPlacemark::LeisureMinigolfCourse] =
1300 createOsmPOIAreaStyle(osmFont, "leisure/miniature_golf", 0x39ac39, 0xb5e3b5, QColor(Qt::transparent));
1301 m_defaultStyle[GeoDataPlacemark::LeisureMarina] = createOsmPOIStyle(osmFont, QString(), QColor(0x95abd5), QColor(0xaec8d1), QColor(0x95abd5).darker(150));
1302 m_defaultStyle[GeoDataPlacemark::LeisurePark] = createWayStyle(QColor(0xc8facc), QColor(0xc8facc).darker(150), true, true);
1303 m_defaultStyle[GeoDataPlacemark::LeisurePlayground] = createOsmPOIAreaStyle(osmFont, "amenity/playground.16", amenityColor, 0xCCFFF1, 0xBDFFED);
1304 m_defaultStyle[GeoDataPlacemark::LeisurePitch] = createWayStyle(0x8ad3af, QColor(0x8ad3af).darker(150), true, true);
1305 m_defaultStyle[GeoDataPlacemark::LeisureSportsCentre] = createWayStyle(0x33cc99, QColor(0x33cc99).darker(150), true, true);
1306 m_defaultStyle[GeoDataPlacemark::LeisureStadium] = createWayStyle(0x33cc99, QColor(0x33cc99).darker(150), true, true);
1307 m_defaultStyle[GeoDataPlacemark::LeisureTrack] = createWayStyle(0x74dcba, QColor(0x74dcba).darker(150), true, true);
1308 m_defaultStyle[GeoDataPlacemark::LeisureSwimmingPool] = createWayStyle(waterColor, waterColor.darker(150), true, true);
1309
1310 m_defaultStyle[GeoDataPlacemark::LanduseAllotments] =
1311 createWayStyle(0xE4C6AA, 0xE4C6AA, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/allotments.png"));
1312 m_defaultStyle[GeoDataPlacemark::LanduseBasin] = createWayStyle(QColor(0xB5, 0xD0, 0xD0, 0x80), QColor(0xB5, 0xD0, 0xD0));
1313 m_defaultStyle[GeoDataPlacemark::LanduseCemetery] =
1314 createWayStyle(0xAACBAF, 0xAACBAF, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_generic.png"));
1315 m_defaultStyle[GeoDataPlacemark::LanduseCommercial] = createWayStyle(0xF2DAD9, 0xD1B2B0, true, true);
1316 m_defaultStyle[GeoDataPlacemark::LanduseConstruction] = createWayStyle(0xb6b592, 0xb6b592, true, false);
1317 m_defaultStyle[GeoDataPlacemark::LanduseFarmland] = createWayStyle(0xEDDDC9, 0xC8B69E, true, true);
1318 m_defaultStyle[GeoDataPlacemark::LanduseFarmyard] = createWayStyle(0xEFD6B5, 0xD1B48C, true, true);
1319 m_defaultStyle[GeoDataPlacemark::LanduseGarages] = createWayStyle(0xE0DDCD, 0xE0DDCD, true, false);
1320 m_defaultStyle[GeoDataPlacemark::LanduseGrass] = createWayStyle(0xA8C8A5, 0xA8C8A5, true, false);
1321 m_defaultStyle[GeoDataPlacemark::LanduseIndustrial] = createWayStyle(0xDED0D5, 0xDED0D5, true, false);
1322 m_defaultStyle[GeoDataPlacemark::LanduseLandfill] = createWayStyle(0xb6b592, 0xb6b592, true, false);
1323 m_defaultStyle[GeoDataPlacemark::LanduseMeadow] = createWayStyle(0xcdebb0, 0xcdebb0, true, false);
1324 m_defaultStyle[GeoDataPlacemark::LanduseMilitary] =
1325 createWayStyle(0xF3D8D2, 0xF3D8D2, true, true, Qt::BDiagPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/military_red_hatch.png"));
1326 m_defaultStyle[GeoDataPlacemark::LanduseQuarry] =
1327 createWayStyle(0xC4C2C2, 0xC4C2C2, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/quarry.png"));
1328 m_defaultStyle[GeoDataPlacemark::LanduseRailway] = createWayStyle(0xDED0D5, 0xDED0D5, true, false);
1329 m_defaultStyle[GeoDataPlacemark::LanduseReservoir] = createWayStyle(waterColor, waterColor, true, false);
1330 m_defaultStyle[GeoDataPlacemark::LanduseResidential] = createWayStyle(0xDCDCDC, 0xDCDCDC, true, false);
1331 m_defaultStyle[GeoDataPlacemark::LanduseRetail] = createWayStyle(0xFFD6D1, 0xD99C95, true, true);
1332 m_defaultStyle[GeoDataPlacemark::LanduseOrchard] =
1333 createWayStyle(0xAEDFA3, 0xAEDFA3, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/orchard.png"));
1334 m_defaultStyle[GeoDataPlacemark::LanduseVineyard] =
1335 createWayStyle(0xAEDFA3, 0xAEDFA3, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/vineyard.png"));
1336
1337 m_defaultStyle[GeoDataPlacemark::MilitaryDangerArea] =
1338 createWayStyle(0xFFC0CB, 0xFFC0CB, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/danger.png"));
1339
1340 m_defaultStyle[GeoDataPlacemark::RailwayRail] = createStyle(2.0,
1341 1.435,
1342 0x706E70,
1343 0xEEEEEE,
1344 true,
1345 true,
1349 true,
1350 QList<qreal>() << 2 << 3,
1351 osmFont,
1353 m_defaultStyle[GeoDataPlacemark::RailwayNarrowGauge] = createStyle(2.0,
1354 1.0,
1355 0x706E70,
1356 0xEEEEEE,
1357 true,
1358 true,
1362 true,
1363 QList<qreal>() << 2 << 3,
1364 osmFont,
1366 // FIXME: the tram is currently being rendered as a polygon.
1367 m_defaultStyle[GeoDataPlacemark::RailwayTram] = createStyle(2.0,
1368 1.435,
1369 0x706E70,
1370 0xB7B6B7,
1371 false,
1372 true,
1376 false,
1377 QList<qreal>(),
1378 osmFont,
1380 m_defaultStyle[GeoDataPlacemark::RailwayLightRail] = createStyle(2.0,
1381 1.435,
1382 0x706E70,
1383 0x706E70,
1384 false,
1385 true,
1389 false,
1390 QList<qreal>(),
1391 osmFont,
1393 m_defaultStyle[GeoDataPlacemark::RailwayAbandoned] = createStyle(2.0,
1394 1.435,
1396 0x706E70,
1397 false,
1398 false,
1402 false,
1403 QList<qreal>(),
1404 osmFont,
1406 m_defaultStyle[GeoDataPlacemark::RailwaySubway] = createStyle(2.0,
1407 1.435,
1408 0x706E70,
1409 0xEEEEEE,
1410 false,
1411 true,
1415 false,
1416 QList<qreal>(),
1417 osmFont,
1419 m_defaultStyle[GeoDataPlacemark::RailwayPreserved] = createStyle(2.0,
1420 1.435,
1421 0xEEEEEE,
1422 0x706E70,
1423 true,
1424 true,
1428 true,
1429 QList<qreal>(),
1430 osmFont,
1432 m_defaultStyle[GeoDataPlacemark::RailwayMiniature] = createStyle(2.0,
1433 1.435,
1434 0x706E70,
1435 0xEEEEEE,
1436 false,
1437 true,
1441 false,
1442 QList<qreal>(),
1443 osmFont,
1445 m_defaultStyle[GeoDataPlacemark::RailwayConstruction] = createStyle(2.0,
1446 1.435,
1447 0xEEEEEE,
1448 0x706E70,
1449 true,
1450 true,
1454 true,
1455 QList<qreal>(),
1456 osmFont,
1458 m_defaultStyle[GeoDataPlacemark::RailwayMonorail] = createStyle(2.0,
1459 1.435,
1460 0x706E70,
1461 0xEEEEEE,
1462 false,
1463 true,
1467 false,
1468 QList<qreal>(),
1469 osmFont,
1471 m_defaultStyle[GeoDataPlacemark::RailwayFunicular] = createStyle(2.0,
1472 1.435,
1473 0x706E70,
1474 0xEEEEEE,
1475 false,
1476 true,
1480 false,
1481 QList<qreal>(),
1482 osmFont,
1484
1485 m_defaultStyle[GeoDataPlacemark::Landmass] = createWayStyle(0xF1EEE8, 0xF1EEE8, true, false);
1486 m_defaultStyle[GeoDataPlacemark::UrbanArea] = createWayStyle(0xE6E3DD, 0xE6E3DD, true, false);
1487 m_defaultStyle[GeoDataPlacemark::InternationalDateLine] =
1488 createStyle(1.0, 0.0, Qt::black, Qt::black, false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false, QList<qreal>(), osmFont);
1489 m_defaultStyle[GeoDataPlacemark::Bathymetry] = createWayStyle(0xa5c9c9, 0xa5c9c9, true, false);
1490
1491 m_defaultStyle[GeoDataPlacemark::AerialwayStation] = createOsmPOIStyle(osmFont, "individual/railway_station", transportationColor);
1492 m_defaultStyle[GeoDataPlacemark::AerialwayStation]->iconStyle().setScale(0.33f);
1493 m_defaultStyle[GeoDataPlacemark::AerialwayPylon] = createOsmPOIStyle(osmFont, "individual/pylon", QColor(0xdddddd));
1494 m_defaultStyle[GeoDataPlacemark::AerialwayPylon]->iconStyle().setScale(0.33f);
1495 m_defaultStyle[GeoDataPlacemark::AerialwayCableCar] =
1496 createIconWayStyle(0xbbbbbb, osmFont, transportationColor, 1.0, QStringLiteral("svg/thenounproject/transportation-583813-cable-car.svg"));
1497 m_defaultStyle[GeoDataPlacemark::AerialwayGondola] =
1498 createIconWayStyle(0xbbbbbb, osmFont, transportationColor, 1.0, QStringLiteral("svg/thenounproject/transportation-21636-gondola.svg"));
1499 m_defaultStyle[GeoDataPlacemark::AerialwayChairLift] =
1500 createIconWayStyle(0xbbbbbb, osmFont, transportationColor, 1.0, QStringLiteral("svg/thenounproject/transportation-231-chair-lift.svg"));
1501 m_defaultStyle[GeoDataPlacemark::AerialwayMixedLift] = createIconWayStyle(0xbbbbbb, osmFont, transportationColor);
1502 m_defaultStyle[GeoDataPlacemark::AerialwayDragLift] =
1503 createIconWayStyle(0xbbbbbb, osmFont, transportationColor, 1.0, QStringLiteral("svg/thenounproject/transportation-8803-platter-lift.svg"));
1504 m_defaultStyle[GeoDataPlacemark::AerialwayTBar] =
1505 createIconWayStyle(0xbbbbbb, osmFont, transportationColor, 1.0, QStringLiteral("svg/thenounproject/transportation-8803-platter-lift.svg"));
1506 m_defaultStyle[GeoDataPlacemark::AerialwayJBar] =
1507 createIconWayStyle(0xbbbbbb, osmFont, transportationColor, 1.0, QStringLiteral("svg/thenounproject/transportation-8803-platter-lift.svg"));
1508 m_defaultStyle[GeoDataPlacemark::AerialwayPlatter] =
1509 createIconWayStyle(0xbbbbbb, osmFont, transportationColor, 1.0, QStringLiteral("svg/thenounproject/transportation-8803-platter-lift.svg"));
1510 m_defaultStyle[GeoDataPlacemark::AerialwayRopeTow] = createIconWayStyle(0xbbbbbb, osmFont, transportationColor);
1511 m_defaultStyle[GeoDataPlacemark::AerialwayMagicCarpet] = createIconWayStyle(0xbbbbbb, osmFont, transportationColor);
1512 m_defaultStyle[GeoDataPlacemark::AerialwayZipLine] = createIconWayStyle(0xbbbbbb, osmFont, transportationColor);
1513 m_defaultStyle[GeoDataPlacemark::AerialwayGoods] = createIconWayStyle(0xbbbbbb, osmFont, transportationColor);
1514
1515 m_defaultStyle[GeoDataPlacemark::PisteDownhill] = createStyle(9,
1516 0.0,
1517 0xdddddd,
1519 true,
1520 false,
1524 false,
1525 QList<qreal>(),
1526 osmFont,
1528 m_defaultStyle[GeoDataPlacemark::PisteNordic] = createStyle(3,
1529 0.0,
1530 0xfffafa,
1531 0x006666,
1532 true,
1533 false,
1537 false,
1538 QList<qreal>(),
1539 osmFont,
1541 MarbleDirs::path("bitmaps/osmcarto/patterns/ice.png"));
1542 m_defaultStyle[GeoDataPlacemark::PisteSkitour] = m_defaultStyle[GeoDataPlacemark::PisteNordic];
1543 m_defaultStyle[GeoDataPlacemark::PisteSled] = m_defaultStyle[GeoDataPlacemark::PisteNordic];
1544 m_defaultStyle[GeoDataPlacemark::PisteHike] = m_defaultStyle[GeoDataPlacemark::PisteNordic];
1545 m_defaultStyle[GeoDataPlacemark::PisteSleigh] = m_defaultStyle[GeoDataPlacemark::PisteNordic];
1546 m_defaultStyle[GeoDataPlacemark::PisteIceSkate] = m_defaultStyle[GeoDataPlacemark::PisteNordic];
1547 m_defaultStyle[GeoDataPlacemark::PisteSnowPark] = m_defaultStyle[GeoDataPlacemark::PisteNordic];
1548 m_defaultStyle[GeoDataPlacemark::PistePlayground] = m_defaultStyle[GeoDataPlacemark::PisteNordic];
1549 m_defaultStyle[GeoDataPlacemark::PisteSkiJump] =
1550 createIconWayStyle(0xbbbbbb, osmFont, transportationColor, 1.0, QStringLiteral("svg/thenounproject/sports-245-ski-jump.svg"));
1551
1552 m_defaultStyle[GeoDataPlacemark::AdminLevel1] =
1553 createStyle(0.0, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::CustomDashLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1554 m_defaultStyle[GeoDataPlacemark::AdminLevel2] =
1555 createStyle(2.0, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1556 m_defaultStyle[GeoDataPlacemark::AdminLevel3] =
1557 createStyle(1.8, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::DashLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1558 m_defaultStyle[GeoDataPlacemark::AdminLevel4] =
1559 createStyle(1.5, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1560 m_defaultStyle[GeoDataPlacemark::AdminLevel5] = createStyle(1.25,
1561 0.0,
1562 0xDF9CCF,
1563 0xDF9CCF,
1564 false,
1565 true,
1569 false,
1570 QList<qreal>() << 0.3 << 0.3,
1571 osmFont);
1572 m_defaultStyle[GeoDataPlacemark::AdminLevel6] =
1573 createStyle(1, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::DashDotLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1574 m_defaultStyle[GeoDataPlacemark::AdminLevel7] =
1575 createStyle(1, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::DashLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1576 m_defaultStyle[GeoDataPlacemark::AdminLevel8] =
1577 createStyle(1, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::DashLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1578 m_defaultStyle[GeoDataPlacemark::AdminLevel9] =
1579 createStyle(1.5, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1580 m_defaultStyle[GeoDataPlacemark::AdminLevel10] =
1581 createStyle(1.5, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1582 m_defaultStyle[GeoDataPlacemark::AdminLevel11] =
1583 createStyle(1.5, 0.0, 0xDF9CCF, 0xDF9CCF, false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QList<qreal>() << 0.3 << 0.3, osmFont);
1584
1585 m_defaultStyle[GeoDataPlacemark::BoundaryMaritime] =
1586 createStyle(2.0, 0.0, 0x88b3bf, 0x88b3bf, false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false, QList<qreal>(), osmFont);
1587
1588 m_defaultStyle[GeoDataPlacemark::Satellite] =
1589 GeoDataStyle::Ptr(new GeoDataStyle(MarbleDirs::path("bitmaps/satellite.png"), QFont(defaultFamily, defaultSize, 50, false), defaultLabelColor));
1590
1591 QFont tmp;
1592
1593 // Fonts for areas ...
1594 tmp = m_defaultStyle[GeoDataPlacemark::Continent]->labelStyle().font();
1597 tmp.setBold(true);
1598 m_defaultStyle[GeoDataPlacemark::Continent]->labelStyle().setFont(tmp);
1599
1600 // Fonts for areas ...
1601 tmp = m_defaultStyle[GeoDataPlacemark::Mare]->labelStyle().font();
1604 tmp.setBold(true);
1605 m_defaultStyle[GeoDataPlacemark::Mare]->labelStyle().setFont(tmp);
1606
1607 // Now we need to underline the capitals ...
1608
1609 tmp = m_defaultStyle[GeoDataPlacemark::SmallNationCapital]->labelStyle().font();
1610 tmp.setUnderline(true);
1611 m_defaultStyle[GeoDataPlacemark::SmallNationCapital]->labelStyle().setFont(tmp);
1612
1613 tmp = m_defaultStyle[GeoDataPlacemark::MediumNationCapital]->labelStyle().font();
1614 tmp.setUnderline(true);
1615 m_defaultStyle[GeoDataPlacemark::MediumNationCapital]->labelStyle().setFont(tmp);
1616
1617 tmp = m_defaultStyle[GeoDataPlacemark::BigNationCapital]->labelStyle().font();
1618 tmp.setUnderline(true);
1619 m_defaultStyle[GeoDataPlacemark::BigNationCapital]->labelStyle().setFont(tmp);
1620
1621 tmp = m_defaultStyle[GeoDataPlacemark::LargeNationCapital]->labelStyle().font();
1622 tmp.setUnderline(true);
1623 m_defaultStyle[GeoDataPlacemark::LargeNationCapital]->labelStyle().setFont(tmp);
1624
1625 // Buildings
1626 m_defaultStyle[GeoDataPlacemark::Building] =
1627 createStyle(1, 0, buildingColor, buildingColor.darker(), true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false, QList<qreal>(), osmFont);
1628 for (int i = 0; i < GeoDataPlacemark::LastIndex; ++i) {
1629 if (m_defaultStyle[i] && !m_defaultStyle[i]->iconStyle().iconPath().isEmpty()) {
1630 auto const category = GeoDataPlacemark::GeoDataVisualCategory(i);
1631 m_buildingStyles[category] = GeoDataStyle::Ptr(new GeoDataStyle(*m_defaultStyle[GeoDataPlacemark::Building]));
1632 m_buildingStyles[category]->iconStyle() = m_defaultStyle[i]->iconStyle();
1633 m_buildingStyles[category]->labelStyle() = m_defaultStyle[i]->labelStyle();
1634 }
1635 }
1636}
1637
1638QColor StyleBuilder::Private::effectColor(const QColor &color)
1639{
1640 int gray;
1641 switch (s_styleEffect) {
1642 case InvertedEffect:
1643 return {255 - color.red(), 255 - color.green(), 255 - color.blue()};
1644 case GrayscaleEffect:
1645 gray = qMin(255, static_cast<int>(7 * qGray(color.darker(800).rgb())));
1646 return {gray, gray, gray};
1647 case RedModeEffect:
1648 gray = qMin(255, static_cast<int>(7 * qGray(color.darker(800).rgb())));
1649 return {gray, 0, 0};
1650 case NoEffect:
1651 return color;
1652 }
1653
1654 return color;
1655}
1656
1657QString StyleBuilder::Private::createPaintLayerItem(const QString &itemType, GeoDataPlacemark::GeoDataVisualCategory visualCategory, const QString &subType)
1658{
1659 QString const category = visualCategoryName(visualCategory);
1660 if (subType.isEmpty()) {
1661 return itemType + QLatin1Char('/') + category;
1662 } else {
1663 return itemType + QLatin1Char('/') + category + QLatin1Char('/') + subType;
1664 }
1665}
1666
1667void StyleBuilder::Private::initializeOsmVisualCategories()
1668{
1669 // Only initialize the map once
1670 if (!s_visualCategories.isEmpty()) {
1671 return;
1672 }
1673
1674 s_visualCategories[OsmTag("admin_level", "1")] = GeoDataPlacemark::AdminLevel1;
1675 s_visualCategories[OsmTag("admin_level", "2")] = GeoDataPlacemark::AdminLevel2;
1676 s_visualCategories[OsmTag("admin_level", "3")] = GeoDataPlacemark::AdminLevel3;
1677 s_visualCategories[OsmTag("admin_level", "4")] = GeoDataPlacemark::AdminLevel4;
1678 s_visualCategories[OsmTag("admin_level", "5")] = GeoDataPlacemark::AdminLevel5;
1679 s_visualCategories[OsmTag("admin_level", "6")] = GeoDataPlacemark::AdminLevel6;
1680 s_visualCategories[OsmTag("admin_level", "7")] = GeoDataPlacemark::AdminLevel7;
1681 s_visualCategories[OsmTag("admin_level", "8")] = GeoDataPlacemark::AdminLevel8;
1682 s_visualCategories[OsmTag("admin_level", "9")] = GeoDataPlacemark::AdminLevel9;
1683 s_visualCategories[OsmTag("admin_level", "10")] = GeoDataPlacemark::AdminLevel10;
1684 s_visualCategories[OsmTag("admin_level", "11")] = GeoDataPlacemark::AdminLevel11;
1685
1686 s_visualCategories[OsmTag("boundary", "maritime")] = GeoDataPlacemark::BoundaryMaritime;
1687
1688 s_visualCategories[OsmTag("amenity", "restaurant")] = GeoDataPlacemark::FoodRestaurant;
1689 s_visualCategories[OsmTag("amenity", "fast_food")] = GeoDataPlacemark::FoodFastFood;
1690 s_visualCategories[OsmTag("amenity", "pub")] = GeoDataPlacemark::FoodPub;
1691 s_visualCategories[OsmTag("amenity", "bar")] = GeoDataPlacemark::FoodBar;
1692 s_visualCategories[OsmTag("amenity", "cafe")] = GeoDataPlacemark::FoodCafe;
1693 s_visualCategories[OsmTag("amenity", "biergarten")] = GeoDataPlacemark::FoodBiergarten;
1694
1695 s_visualCategories[OsmTag("amenity", "college")] = GeoDataPlacemark::EducationCollege;
1696 s_visualCategories[OsmTag("amenity", "school")] = GeoDataPlacemark::EducationSchool;
1697 s_visualCategories[OsmTag("amenity", "university")] = GeoDataPlacemark::EducationUniversity;
1698
1699 s_visualCategories[OsmTag("amenity", "childcare")] = GeoDataPlacemark::AmenityKindergarten;
1700 s_visualCategories[OsmTag("amenity", "kindergarten")] = GeoDataPlacemark::AmenityKindergarten;
1701 s_visualCategories[OsmTag("amenity", "library")] = GeoDataPlacemark::AmenityLibrary;
1702
1703 s_visualCategories[OsmTag("amenity", "bus_station")] = GeoDataPlacemark::TransportBusStation;
1704 s_visualCategories[OsmTag("amenity", "car_sharing")] = GeoDataPlacemark::TransportCarShare;
1705 s_visualCategories[OsmTag("amenity", "fuel")] = GeoDataPlacemark::TransportFuel;
1706 s_visualCategories[OsmTag("amenity", "parking")] = GeoDataPlacemark::TransportParking;
1707 s_visualCategories[OsmTag("amenity", "parking_space")] = GeoDataPlacemark::TransportParkingSpace;
1708
1709 s_visualCategories[OsmTag("amenity", "atm")] = GeoDataPlacemark::MoneyAtm;
1710 s_visualCategories[OsmTag("amenity", "bank")] = GeoDataPlacemark::MoneyBank;
1711
1712 s_visualCategories[OsmTag("historic", "archaeological_site")] = GeoDataPlacemark::HistoricArchaeologicalSite;
1713 s_visualCategories[OsmTag("historic", "castle")] = GeoDataPlacemark::HistoricCastle;
1714 s_visualCategories[OsmTag("historic", "fort")] = GeoDataPlacemark::HistoricCastle;
1715 s_visualCategories[OsmTag("historic", "memorial")] = GeoDataPlacemark::HistoricMemorial;
1716 s_visualCategories[OsmTag("historic", "monument")] = GeoDataPlacemark::HistoricMonument;
1717 s_visualCategories[OsmTag("historic", "ruins")] = GeoDataPlacemark::HistoricRuins;
1718
1719 s_visualCategories[OsmTag("amenity", "bench")] = GeoDataPlacemark::AmenityBench;
1720 s_visualCategories[OsmTag("amenity", "car_wash")] = GeoDataPlacemark::AmenityCarWash;
1721 s_visualCategories[OsmTag("amenity", "charging_station")] = GeoDataPlacemark::AmenityChargingStation;
1722 s_visualCategories[OsmTag("amenity", "cinema")] = GeoDataPlacemark::AmenityCinema;
1723 s_visualCategories[OsmTag("amenity", "community_centre")] = GeoDataPlacemark::AmenityCommunityCentre;
1724 s_visualCategories[OsmTag("amenity", "courthouse")] = GeoDataPlacemark::AmenityCourtHouse;
1725 s_visualCategories[OsmTag("amenity", "drinking_water")] = GeoDataPlacemark::AmenityDrinkingWater;
1726 s_visualCategories[OsmTag("amenity", "embassy")] = GeoDataPlacemark::AmenityEmbassy;
1727 s_visualCategories[OsmTag("amenity", "fire_station")] = GeoDataPlacemark::AmenityFireStation;
1728 s_visualCategories[OsmTag("amenity", "fountain")] = GeoDataPlacemark::AmenityFountain;
1729 s_visualCategories[OsmTag("amenity", "graveyard")] = GeoDataPlacemark::AmenityGraveyard;
1730 s_visualCategories[OsmTag("amenity", "hunting_stand")] = GeoDataPlacemark::AmenityHuntingStand;
1731 s_visualCategories[OsmTag("amenity", "nightclub")] = GeoDataPlacemark::AmenityNightClub;
1732 s_visualCategories[OsmTag("amenity", "police")] = GeoDataPlacemark::AmenityPolice;
1733 s_visualCategories[OsmTag("amenity", "post_box")] = GeoDataPlacemark::AmenityPostBox;
1734 s_visualCategories[OsmTag("amenity", "post_office")] = GeoDataPlacemark::AmenityPostOffice;
1735 s_visualCategories[OsmTag("amenity", "prison")] = GeoDataPlacemark::AmenityPrison;
1736 s_visualCategories[OsmTag("amenity", "recycling")] = GeoDataPlacemark::AmenityRecycling;
1737 s_visualCategories[OsmTag("amenity", "shelter")] = GeoDataPlacemark::AmenityShelter;
1738 s_visualCategories[OsmTag("amenity", "social_facility")] = GeoDataPlacemark::AmenitySocialFacility;
1739 s_visualCategories[OsmTag("amenity", "telephone")] = GeoDataPlacemark::AmenityTelephone;
1740 s_visualCategories[OsmTag("amenity", "theatre")] = GeoDataPlacemark::AmenityTheatre;
1741 s_visualCategories[OsmTag("amenity", "toilets")] = GeoDataPlacemark::AmenityToilets;
1742 s_visualCategories[OsmTag("amenity", "townhall")] = GeoDataPlacemark::AmenityTownHall;
1743 s_visualCategories[OsmTag("amenity", "waste_basket")] = GeoDataPlacemark::AmenityWasteBasket;
1744 s_visualCategories[OsmTag("emergency", "phone")] = GeoDataPlacemark::AmenityEmergencyPhone;
1745 s_visualCategories[OsmTag("amenity", "mountain_rescue")] = GeoDataPlacemark::AmenityMountainRescue;
1746 s_visualCategories[OsmTag("amenity", "dentist")] = GeoDataPlacemark::HealthDentist;
1747 s_visualCategories[OsmTag("amenity", "doctors")] = GeoDataPlacemark::HealthDoctors;
1748 s_visualCategories[OsmTag("amenity", "hospital")] = GeoDataPlacemark::HealthHospital;
1749 s_visualCategories[OsmTag("amenity", "pharmacy")] = GeoDataPlacemark::HealthPharmacy;
1750 s_visualCategories[OsmTag("amenity", "veterinary")] = GeoDataPlacemark::HealthVeterinary;
1751
1752 s_visualCategories[OsmTag("amenity", "place_of_worship")] = GeoDataPlacemark::ReligionPlaceOfWorship;
1753
1754 s_visualCategories[OsmTag("tourism", "information")] = GeoDataPlacemark::TourismInformation;
1755
1756 s_visualCategories[OsmTag("natural", "cave_entrance")] = GeoDataPlacemark::NaturalCave;
1757 s_visualCategories[OsmTag("natural", "peak")] = GeoDataPlacemark::NaturalPeak;
1758 s_visualCategories[OsmTag("natural", "tree")] = GeoDataPlacemark::NaturalTree;
1759 s_visualCategories[OsmTag("natural", "volcano")] = GeoDataPlacemark::NaturalVolcano;
1760
1761 s_visualCategories[OsmTag("shop", "alcohol")] = GeoDataPlacemark::ShopAlcohol;
1762 s_visualCategories[OsmTag("shop", "art")] = GeoDataPlacemark::ShopArt;
1763 s_visualCategories[OsmTag("shop", "bag")] = GeoDataPlacemark::ShopBag;
1764 s_visualCategories[OsmTag("shop", "bakery")] = GeoDataPlacemark::ShopBakery;
1765 s_visualCategories[OsmTag("shop", "beauty")] = GeoDataPlacemark::ShopBeauty;
1766 s_visualCategories[OsmTag("shop", "beverages")] = GeoDataPlacemark::ShopBeverages;
1767 s_visualCategories[OsmTag("shop", "bicycle")] = GeoDataPlacemark::ShopBicycle;
1768 s_visualCategories[OsmTag("shop", "books")] = GeoDataPlacemark::ShopBook;
1769 s_visualCategories[OsmTag("shop", "butcher")] = GeoDataPlacemark::ShopButcher;
1770 s_visualCategories[OsmTag("shop", "car")] = GeoDataPlacemark::ShopCar;
1771 s_visualCategories[OsmTag("shop", "car_parts")] = GeoDataPlacemark::ShopCarParts;
1772 s_visualCategories[OsmTag("shop", "car_repair")] = GeoDataPlacemark::ShopCarRepair;
1773 s_visualCategories[OsmTag("shop", "chemist")] = GeoDataPlacemark::ShopChemist;
1774 s_visualCategories[OsmTag("shop", "clothes")] = GeoDataPlacemark::ShopClothes;
1775 s_visualCategories[OsmTag("shop", "confectionery")] = GeoDataPlacemark::ShopConfectionery;
1776 s_visualCategories[OsmTag("shop", "convenience")] = GeoDataPlacemark::ShopConvenience;
1777 s_visualCategories[OsmTag("shop", "copy")] = GeoDataPlacemark::ShopCopy;
1778 s_visualCategories[OsmTag("shop", "cosmetics")] = GeoDataPlacemark::ShopCosmetics;
1779 s_visualCategories[OsmTag("shop", "deli")] = GeoDataPlacemark::ShopDeli;
1780 s_visualCategories[OsmTag("shop", "department_store")] = GeoDataPlacemark::ShopDepartmentStore;
1781 s_visualCategories[OsmTag("shop", "doityourself")] = GeoDataPlacemark::ShopDoitYourself;
1782 s_visualCategories[OsmTag("shop", "electronics")] = GeoDataPlacemark::ShopElectronics;
1783 s_visualCategories[OsmTag("shop", "fashion")] = GeoDataPlacemark::ShopFashion;
1784 s_visualCategories[OsmTag("shop", "florist")] = GeoDataPlacemark::ShopFlorist;
1785 s_visualCategories[OsmTag("shop", "furniture")] = GeoDataPlacemark::ShopFurniture;
1786 s_visualCategories[OsmTag("shop", "gift")] = GeoDataPlacemark::ShopGift;
1787 s_visualCategories[OsmTag("shop", "greengrocer")] = GeoDataPlacemark::ShopGreengrocer;
1788 s_visualCategories[OsmTag("shop", "hairdresser")] = GeoDataPlacemark::ShopHairdresser;
1789 s_visualCategories[OsmTag("shop", "hardware")] = GeoDataPlacemark::ShopHardware;
1790 s_visualCategories[OsmTag("shop", "hifi")] = GeoDataPlacemark::ShopHifi;
1791 s_visualCategories[OsmTag("shop", "jewelry")] = GeoDataPlacemark::ShopJewelry;
1792 s_visualCategories[OsmTag("shop", "kiosk")] = GeoDataPlacemark::ShopKiosk;
1793 s_visualCategories[OsmTag("shop", "laundry")] = GeoDataPlacemark::ShopLaundry;
1794 s_visualCategories[OsmTag("shop", "mobile_phone")] = GeoDataPlacemark::ShopMobilePhone;
1795 s_visualCategories[OsmTag("shop", "motorcycle")] = GeoDataPlacemark::ShopMotorcycle;
1796 s_visualCategories[OsmTag("shop", "musical_instrument")] = GeoDataPlacemark::ShopMusicalInstrument;
1797 s_visualCategories[OsmTag("shop", "optician")] = GeoDataPlacemark::ShopOptician;
1798 s_visualCategories[OsmTag("shop", "outdoor")] = GeoDataPlacemark::ShopOutdoor;
1799 s_visualCategories[OsmTag("shop", "perfumery")] = GeoDataPlacemark::ShopPerfumery;
1800 s_visualCategories[OsmTag("shop", "pet")] = GeoDataPlacemark::ShopPet;
1801 s_visualCategories[OsmTag("shop", "photo")] = GeoDataPlacemark::ShopPhoto;
1802 s_visualCategories[OsmTag("shop", "seafood")] = GeoDataPlacemark::ShopSeafood;
1803 s_visualCategories[OsmTag("shop", "shoes")] = GeoDataPlacemark::ShopShoes;
1804 s_visualCategories[OsmTag("shop", "sports")] = GeoDataPlacemark::ShopSports;
1805 s_visualCategories[OsmTag("shop", "stationery")] = GeoDataPlacemark::ShopStationery;
1806 s_visualCategories[OsmTag("shop", "supermarket")] = GeoDataPlacemark::ShopSupermarket;
1807 s_visualCategories[OsmTag("shop", "tea")] = GeoDataPlacemark::ShopTea;
1808 s_visualCategories[OsmTag("shop", "computer")] = GeoDataPlacemark::ShopComputer;
1809 s_visualCategories[OsmTag("shop", "garden_centre")] = GeoDataPlacemark::ShopGardenCentre;
1810 s_visualCategories[OsmTag("shop", "tobacco")] = GeoDataPlacemark::ShopTobacco;
1811 s_visualCategories[OsmTag("shop", "toys")] = GeoDataPlacemark::ShopToys;
1812 s_visualCategories[OsmTag("shop", "travel_agency")] = GeoDataPlacemark::ShopTravelAgency;
1813 s_visualCategories[OsmTag("shop", "variety_store")] = GeoDataPlacemark::ShopVarietyStore;
1814
1815 // Default for all other shops
1816 for (const QString &value : shopValues()) {
1817 s_visualCategories[OsmTag("shop", value)] = GeoDataPlacemark::Shop;
1818 }
1819
1820 s_visualCategories[OsmTag("man_made", "bridge")] = GeoDataPlacemark::ManmadeBridge;
1821 s_visualCategories[OsmTag("man_made", "lighthouse")] = GeoDataPlacemark::ManmadeLighthouse;
1822 s_visualCategories[OsmTag("man_made", "pier")] = GeoDataPlacemark::ManmadePier;
1823 s_visualCategories[OsmTag("man_made", "water_tower")] = GeoDataPlacemark::ManmadeWaterTower;
1824 s_visualCategories[OsmTag("man_made", "windmill")] = GeoDataPlacemark::ManmadeWindMill;
1825 s_visualCategories[OsmTag("man_made", "communications_tower")] = GeoDataPlacemark::ManmadeCommunicationsTower;
1826 s_visualCategories[OsmTag("tower:type", "communication")] = GeoDataPlacemark::ManmadeCommunicationsTower;
1827
1828 s_visualCategories[OsmTag("religion", "")] = GeoDataPlacemark::ReligionPlaceOfWorship;
1829 s_visualCategories[OsmTag("religion", "bahai")] = GeoDataPlacemark::ReligionBahai;
1830 s_visualCategories[OsmTag("religion", "buddhist")] = GeoDataPlacemark::ReligionBuddhist;
1831 s_visualCategories[OsmTag("religion", "christian")] = GeoDataPlacemark::ReligionChristian;
1832 s_visualCategories[OsmTag("religion", "hindu")] = GeoDataPlacemark::ReligionHindu;
1833 s_visualCategories[OsmTag("religion", "jain")] = GeoDataPlacemark::ReligionJain;
1834 s_visualCategories[OsmTag("religion", "jewish")] = GeoDataPlacemark::ReligionJewish;
1835 s_visualCategories[OsmTag("religion", "muslim")] = GeoDataPlacemark::ReligionMuslim;
1836 s_visualCategories[OsmTag("religion", "shinto")] = GeoDataPlacemark::ReligionShinto;
1837 s_visualCategories[OsmTag("religion", "sikh")] = GeoDataPlacemark::ReligionSikh;
1838 s_visualCategories[OsmTag("religion", "taoist")] = GeoDataPlacemark::ReligionTaoist;
1839
1840 s_visualCategories[OsmTag("tourism", "camp_site")] = GeoDataPlacemark::AccomodationCamping;
1841 s_visualCategories[OsmTag("tourism", "guest_house")] = GeoDataPlacemark::AccomodationGuestHouse;
1842 s_visualCategories[OsmTag("tourism", "hostel")] = GeoDataPlacemark::AccomodationHostel;
1843 s_visualCategories[OsmTag("tourism", "hotel")] = GeoDataPlacemark::AccomodationHotel;
1844 s_visualCategories[OsmTag("tourism", "motel")] = GeoDataPlacemark::AccomodationMotel;
1845
1846 s_visualCategories[OsmTag("tourism", "alpine_hut")] = GeoDataPlacemark::TourismAlpineHut;
1847 s_visualCategories[OsmTag("tourism", "artwork")] = GeoDataPlacemark::TourismArtwork;
1848 s_visualCategories[OsmTag("tourism", "attraction")] = GeoDataPlacemark::TourismAttraction;
1849 s_visualCategories[OsmTag("tourism", "museum")] = GeoDataPlacemark::TourismMuseum;
1850 s_visualCategories[OsmTag("tourism", "theme_park")] = GeoDataPlacemark::TourismThemePark;
1851 s_visualCategories[OsmTag("tourism", "viewpoint")] = GeoDataPlacemark::TourismViewPoint;
1852 s_visualCategories[OsmTag("tourism", "wilderness_hut")] = GeoDataPlacemark::TourismWildernessHut;
1853 s_visualCategories[OsmTag("tourism", "zoo")] = GeoDataPlacemark::TourismZoo;
1854
1855 s_visualCategories[OsmTag("barrier", "city_wall")] = GeoDataPlacemark::BarrierCityWall;
1856 s_visualCategories[OsmTag("barrier", "gate")] = GeoDataPlacemark::BarrierGate;
1857 s_visualCategories[OsmTag("barrier", "lift_gate")] = GeoDataPlacemark::BarrierLiftGate;
1858 s_visualCategories[OsmTag("barrier", "wall")] = GeoDataPlacemark::BarrierWall;
1859
1860 s_visualCategories[OsmTag("highway", "traffic_signals")] = GeoDataPlacemark::HighwayTrafficSignals;
1861 s_visualCategories[OsmTag("highway", "elevator")] = GeoDataPlacemark::HighwayElevator;
1862
1863 s_visualCategories[OsmTag("highway", "cycleway")] = GeoDataPlacemark::HighwayCycleway;
1864 s_visualCategories[OsmTag("highway", "footway")] = GeoDataPlacemark::HighwayFootway;
1865 s_visualCategories[OsmTag("highway", "living_street")] = GeoDataPlacemark::HighwayLivingStreet;
1866 s_visualCategories[OsmTag("highway", "motorway")] = GeoDataPlacemark::HighwayMotorway;
1867 s_visualCategories[OsmTag("highway", "motorway_link")] = GeoDataPlacemark::HighwayMotorwayLink;
1868 s_visualCategories[OsmTag("highway", "path")] = GeoDataPlacemark::HighwayPath;
1869 s_visualCategories[OsmTag("highway", "pedestrian")] = GeoDataPlacemark::HighwayPedestrian;
1870 s_visualCategories[OsmTag("highway", "primary")] = GeoDataPlacemark::HighwayPrimary;
1871 s_visualCategories[OsmTag("highway", "primary_link")] = GeoDataPlacemark::HighwayPrimaryLink;
1872 s_visualCategories[OsmTag("highway", "raceway")] = GeoDataPlacemark::HighwayRaceway;
1873 s_visualCategories[OsmTag("highway", "residential")] = GeoDataPlacemark::HighwayResidential;
1874 s_visualCategories[OsmTag("highway", "road")] = GeoDataPlacemark::HighwayRoad;
1875 s_visualCategories[OsmTag("highway", "secondary")] = GeoDataPlacemark::HighwaySecondary;
1876 s_visualCategories[OsmTag("highway", "secondary_link")] = GeoDataPlacemark::HighwaySecondaryLink;
1877 s_visualCategories[OsmTag("highway", "service")] = GeoDataPlacemark::HighwayService;
1878 s_visualCategories[OsmTag("highway", "steps")] = GeoDataPlacemark::HighwaySteps;
1879 s_visualCategories[OsmTag("highway", "tertiary")] = GeoDataPlacemark::HighwayTertiary;
1880 s_visualCategories[OsmTag("highway", "tertiary_link")] = GeoDataPlacemark::HighwayTertiaryLink;
1881 s_visualCategories[OsmTag("highway", "track")] = GeoDataPlacemark::HighwayTrack;
1882 s_visualCategories[OsmTag("highway", "trunk")] = GeoDataPlacemark::HighwayTrunk;
1883 s_visualCategories[OsmTag("highway", "trunk_link")] = GeoDataPlacemark::HighwayTrunkLink;
1884 s_visualCategories[OsmTag("highway", "unclassified")] = GeoDataPlacemark::HighwayUnclassified;
1885 s_visualCategories[OsmTag("highway", "unknown")] = GeoDataPlacemark::HighwayUnknown;
1886 s_visualCategories[OsmTag("highway", "corridor")] = GeoDataPlacemark::HighwayCorridor;
1887
1888 s_visualCategories[OsmTag("natural", "bay")] = GeoDataPlacemark::NaturalWater;
1889 s_visualCategories[OsmTag("natural", "coastline")] = GeoDataPlacemark::NaturalWater;
1890 s_visualCategories[OsmTag("natural", "reef")] = GeoDataPlacemark::NaturalReef;
1891 s_visualCategories[OsmTag("natural", "water")] = GeoDataPlacemark::NaturalWater;
1892
1893 s_visualCategories[OsmTag("waterway", "canal")] = GeoDataPlacemark::WaterwayCanal;
1894 s_visualCategories[OsmTag("waterway", "ditch")] = GeoDataPlacemark::WaterwayDitch;
1895 s_visualCategories[OsmTag("waterway", "drain")] = GeoDataPlacemark::WaterwayDrain;
1896 s_visualCategories[OsmTag("waterway", "river")] = GeoDataPlacemark::WaterwayRiver;
1897 s_visualCategories[OsmTag("waterway", "riverbank")] = GeoDataPlacemark::NaturalWater;
1898 s_visualCategories[OsmTag("waterway", "weir")] = GeoDataPlacemark::WaterwayWeir;
1899 s_visualCategories[OsmTag("waterway", "stream")] = GeoDataPlacemark::WaterwayStream;
1900
1901 s_visualCategories[OsmTag("natural", "beach")] = GeoDataPlacemark::NaturalBeach;
1902 s_visualCategories[OsmTag("natural", "cliff")] = GeoDataPlacemark::NaturalCliff;
1903 s_visualCategories[OsmTag("natural", "glacier")] = GeoDataPlacemark::NaturalGlacier;
1904 s_visualCategories[OsmTag("glacier:type", "shelf")] = GeoDataPlacemark::NaturalIceShelf;
1905 s_visualCategories[OsmTag("natural", "scrub")] = GeoDataPlacemark::NaturalScrub;
1906 s_visualCategories[OsmTag("natural", "wetland")] = GeoDataPlacemark::NaturalWetland;
1907 s_visualCategories[OsmTag("natural", "wood")] = GeoDataPlacemark::NaturalWood;
1908
1909 s_visualCategories[OsmTag("military", "danger_area")] = GeoDataPlacemark::MilitaryDangerArea;
1910
1911 s_visualCategories[OsmTag("landuse", "allotments")] = GeoDataPlacemark::LanduseAllotments;
1912 s_visualCategories[OsmTag("landuse", "basin")] = GeoDataPlacemark::LanduseBasin;
1913 s_visualCategories[OsmTag("landuse", "brownfield")] = GeoDataPlacemark::LanduseConstruction;
1914 s_visualCategories[OsmTag("landuse", "cemetery")] = GeoDataPlacemark::LanduseCemetery;
1915 s_visualCategories[OsmTag("landuse", "commercial")] = GeoDataPlacemark::LanduseCommercial;
1916 s_visualCategories[OsmTag("landuse", "construction")] = GeoDataPlacemark::LanduseConstruction;
1917 s_visualCategories[OsmTag("landuse", "farm")] = GeoDataPlacemark::LanduseFarmland;
1918 s_visualCategories[OsmTag("landuse", "farmland")] = GeoDataPlacemark::LanduseFarmland;
1919 s_visualCategories[OsmTag("landuse", "farmyard")] = GeoDataPlacemark::LanduseFarmland;
1920 s_visualCategories[OsmTag("landuse", "forest")] = GeoDataPlacemark::NaturalWood;
1921 s_visualCategories[OsmTag("landuse", "garages")] = GeoDataPlacemark::LanduseGarages;
1922 s_visualCategories[OsmTag("landuse", "grass")] = GeoDataPlacemark::LanduseGrass;
1923 s_visualCategories[OsmTag("landuse", "greenfield")] = GeoDataPlacemark::LanduseConstruction;
1924 s_visualCategories[OsmTag("landuse", "greenhouse_horticulture")] = GeoDataPlacemark::LanduseFarmland;
1925 s_visualCategories[OsmTag("landuse", "industrial")] = GeoDataPlacemark::LanduseIndustrial;
1926 s_visualCategories[OsmTag("landuse", "landfill")] = GeoDataPlacemark::LanduseLandfill;
1927 s_visualCategories[OsmTag("landuse", "meadow")] = GeoDataPlacemark::LanduseMeadow;
1928 s_visualCategories[OsmTag("landuse", "military")] = GeoDataPlacemark::LanduseMilitary;
1929 s_visualCategories[OsmTag("landuse", "orchard")] = GeoDataPlacemark::LanduseFarmland;
1930 s_visualCategories[OsmTag("landuse", "orchard")] = GeoDataPlacemark::LanduseOrchard;
1931 s_visualCategories[OsmTag("landuse", "quarry")] = GeoDataPlacemark::LanduseQuarry;
1932 s_visualCategories[OsmTag("landuse", "railway")] = GeoDataPlacemark::LanduseRailway;
1933 s_visualCategories[OsmTag("landuse", "recreation_ground")] = GeoDataPlacemark::LeisurePark;
1934 s_visualCategories[OsmTag("landuse", "reservoir")] = GeoDataPlacemark::LanduseReservoir;
1935 s_visualCategories[OsmTag("landuse", "residential")] = GeoDataPlacemark::LanduseResidential;
1936 s_visualCategories[OsmTag("landuse", "retail")] = GeoDataPlacemark::LanduseRetail;
1937 s_visualCategories[OsmTag("landuse", "village_green")] = GeoDataPlacemark::LanduseGrass;
1938 s_visualCategories[OsmTag("landuse", "vineyard")] = GeoDataPlacemark::LanduseVineyard;
1939
1940 s_visualCategories[OsmTag("leisure", "common")] = GeoDataPlacemark::LanduseGrass;
1941 s_visualCategories[OsmTag("leisure", "garden")] = GeoDataPlacemark::LanduseGrass;
1942
1943 s_visualCategories[OsmTag("leisure", "golf_course")] = GeoDataPlacemark::LeisureGolfCourse;
1944 s_visualCategories[OsmTag("leisure", "marina")] = GeoDataPlacemark::LeisureMarina;
1945 s_visualCategories[OsmTag("leisure", "miniature_golf")] = GeoDataPlacemark::LeisureMinigolfCourse;
1946 s_visualCategories[OsmTag("leisure", "park")] = GeoDataPlacemark::LeisurePark;
1947 s_visualCategories[OsmTag("leisure", "pitch")] = GeoDataPlacemark::LeisurePitch;
1948 s_visualCategories[OsmTag("leisure", "playground")] = GeoDataPlacemark::LeisurePlayground;
1949 s_visualCategories[OsmTag("leisure", "sports_centre")] = GeoDataPlacemark::LeisureSportsCentre;
1950 s_visualCategories[OsmTag("leisure", "stadium")] = GeoDataPlacemark::LeisureStadium;
1951 s_visualCategories[OsmTag("leisure", "swimming_pool")] = GeoDataPlacemark::LeisureSwimmingPool;
1952 s_visualCategories[OsmTag("leisure", "track")] = GeoDataPlacemark::LeisureTrack;
1953 s_visualCategories[OsmTag("leisure", "water_park")] = GeoDataPlacemark::LeisureWaterPark;
1954
1955 s_visualCategories[OsmTag("railway", "abandoned")] = GeoDataPlacemark::RailwayAbandoned;
1956 s_visualCategories[OsmTag("railway", "construction")] = GeoDataPlacemark::RailwayConstruction;
1957 s_visualCategories[OsmTag("railway", "disused")] = GeoDataPlacemark::RailwayAbandoned;
1958 s_visualCategories[OsmTag("railway", "funicular")] = GeoDataPlacemark::RailwayFunicular;
1959 s_visualCategories[OsmTag("railway", "halt")] = GeoDataPlacemark::TransportTrainStation;
1960 s_visualCategories[OsmTag("railway", "light_rail")] = GeoDataPlacemark::RailwayLightRail;
1961 s_visualCategories[OsmTag("railway", "miniature")] = GeoDataPlacemark::RailwayMiniature;
1962 s_visualCategories[OsmTag("railway", "monorail")] = GeoDataPlacemark::RailwayMonorail;
1963 s_visualCategories[OsmTag("railway", "narrow_gauge")] = GeoDataPlacemark::RailwayNarrowGauge;
1964 s_visualCategories[OsmTag("railway", "platform")] = GeoDataPlacemark::TransportPlatform;
1965 s_visualCategories[OsmTag("railway", "preserved")] = GeoDataPlacemark::RailwayPreserved;
1966 s_visualCategories[OsmTag("railway", "rail")] = GeoDataPlacemark::RailwayRail;
1967 s_visualCategories[OsmTag("railway", "razed")] = GeoDataPlacemark::RailwayAbandoned;
1968 s_visualCategories[OsmTag("railway", "station")] = GeoDataPlacemark::TransportTrainStation;
1969 s_visualCategories[OsmTag("public_transport", "station")] = GeoDataPlacemark::TransportTrainStation;
1970 s_visualCategories[OsmTag("railway", "subway")] = GeoDataPlacemark::RailwaySubway;
1971 s_visualCategories[OsmTag("railway", "tram")] = GeoDataPlacemark::RailwayTram;
1972
1973 s_visualCategories[OsmTag("power", "tower")] = GeoDataPlacemark::PowerTower;
1974
1975 s_visualCategories[OsmTag("aeroway", "aerodrome")] = GeoDataPlacemark::TransportAerodrome;
1976 s_visualCategories[OsmTag("aeroway", "apron")] = GeoDataPlacemark::TransportAirportApron;
1977 s_visualCategories[OsmTag("aeroway", "gate")] = GeoDataPlacemark::TransportAirportGate;
1978 s_visualCategories[OsmTag("aeroway", "helipad")] = GeoDataPlacemark::TransportHelipad;
1979 s_visualCategories[OsmTag("aeroway", "runway")] = GeoDataPlacemark::TransportAirportRunway;
1980 s_visualCategories[OsmTag("aeroway", "taxiway")] = GeoDataPlacemark::TransportAirportTaxiway;
1981 s_visualCategories[OsmTag("aeroway", "terminal")] = GeoDataPlacemark::TransportAirportTerminal;
1982
1983 s_visualCategories[OsmTag("piste:type", "downhill")] = GeoDataPlacemark::PisteDownhill;
1984 s_visualCategories[OsmTag("piste:type", "nordic")] = GeoDataPlacemark::PisteNordic;
1985 s_visualCategories[OsmTag("piste:type", "skitour")] = GeoDataPlacemark::PisteSkitour;
1986 s_visualCategories[OsmTag("piste:type", "sled")] = GeoDataPlacemark::PisteSled;
1987 s_visualCategories[OsmTag("piste:type", "hike")] = GeoDataPlacemark::PisteHike;
1988 s_visualCategories[OsmTag("piste:type", "sleigh")] = GeoDataPlacemark::PisteSleigh;
1989 s_visualCategories[OsmTag("piste:type", "ice_skate")] = GeoDataPlacemark::PisteIceSkate;
1990 s_visualCategories[OsmTag("piste:type", "snow_park")] = GeoDataPlacemark::PisteSnowPark;
1991 s_visualCategories[OsmTag("piste:type", "playground")] = GeoDataPlacemark::PistePlayground;
1992 s_visualCategories[OsmTag("piste:type", "ski_jump")] = GeoDataPlacemark::PisteSkiJump;
1993
1994 s_visualCategories[OsmTag("amenity", "bicycle_parking")] = GeoDataPlacemark::TransportBicycleParking;
1995 s_visualCategories[OsmTag("amenity", "bicycle_rental")] = GeoDataPlacemark::TransportRentalBicycle;
1996 s_visualCategories[OsmTag("rental", "bicycle")] = GeoDataPlacemark::TransportRentalBicycle;
1997 s_visualCategories[OsmTag("amenity", "car_rental")] = GeoDataPlacemark::TransportRentalCar;
1998 s_visualCategories[OsmTag("rental", "car")] = GeoDataPlacemark::TransportRentalCar;
1999 s_visualCategories[OsmTag("amenity", "ski_rental")] = GeoDataPlacemark::TransportRentalSki;
2000 s_visualCategories[OsmTag("rental", "ski")] = GeoDataPlacemark::TransportRentalSki;
2001 s_visualCategories[OsmTag("amenity", "motorcycle_parking")] = GeoDataPlacemark::TransportMotorcycleParking;
2002 s_visualCategories[OsmTag("amenity", "taxi")] = GeoDataPlacemark::TransportTaxiRank;
2003 s_visualCategories[OsmTag("highway", "bus_stop")] = GeoDataPlacemark::TransportBusStop;
2004 s_visualCategories[OsmTag("highway", "speed_camera")] = GeoDataPlacemark::TransportSpeedCamera;
2005 s_visualCategories[OsmTag("public_transport", "platform")] = GeoDataPlacemark::TransportPlatform;
2006 s_visualCategories[OsmTag("railway", "subway_entrance")] = GeoDataPlacemark::TransportSubwayEntrance;
2007 s_visualCategories[OsmTag("railway", "tram_stop")] = GeoDataPlacemark::TransportTramStop;
2008
2009 s_visualCategories[OsmTag("place", "city")] = GeoDataPlacemark::PlaceCity;
2010 s_visualCategories[OsmTag("place", "hamlet")] = GeoDataPlacemark::PlaceHamlet;
2011 s_visualCategories[OsmTag("place", "locality")] = GeoDataPlacemark::PlaceLocality;
2012 s_visualCategories[OsmTag("place", "suburb")] = GeoDataPlacemark::PlaceSuburb;
2013 s_visualCategories[OsmTag("place", "town")] = GeoDataPlacemark::PlaceTown;
2014 s_visualCategories[OsmTag("place", "village")] = GeoDataPlacemark::PlaceVillage;
2015
2016 s_visualCategories[OsmTag("aerialway", "station")] = GeoDataPlacemark::AerialwayStation;
2017 s_visualCategories[OsmTag("aerialway", "pylon")] = GeoDataPlacemark::AerialwayPylon;
2018 s_visualCategories[OsmTag("aerialway", "cable_car")] = GeoDataPlacemark::AerialwayCableCar;
2019 s_visualCategories[OsmTag("aerialway", "gondola")] = GeoDataPlacemark::AerialwayGondola;
2020 s_visualCategories[OsmTag("aerialway", "chair_lift")] = GeoDataPlacemark::AerialwayChairLift;
2021 s_visualCategories[OsmTag("aerialway", "mixed_lift")] = GeoDataPlacemark::AerialwayMixedLift;
2022 s_visualCategories[OsmTag("aerialway", "drag_lift")] = GeoDataPlacemark::AerialwayDragLift;
2023 s_visualCategories[OsmTag("aerialway", "t-bar")] = GeoDataPlacemark::AerialwayTBar;
2024 s_visualCategories[OsmTag("aerialway", "j-bar")] = GeoDataPlacemark::AerialwayJBar;
2025 s_visualCategories[OsmTag("aerialway", "platter")] = GeoDataPlacemark::AerialwayPlatter;
2026 s_visualCategories[OsmTag("aerialway", "rope_tow")] = GeoDataPlacemark::AerialwayRopeTow;
2027 s_visualCategories[OsmTag("aerialway", "magic_carpet")] = GeoDataPlacemark::AerialwayMagicCarpet;
2028 s_visualCategories[OsmTag("aerialway", "zip_line")] = GeoDataPlacemark::AerialwayZipLine;
2029 s_visualCategories[OsmTag("aerialway", "goods")] = GeoDataPlacemark::AerialwayGoods;
2030
2031 s_visualCategories[OsmTag("indoor", "door")] = GeoDataPlacemark::IndoorDoor;
2032 s_visualCategories[OsmTag("indoor", "wall")] = GeoDataPlacemark::IndoorWall;
2033 s_visualCategories[OsmTag("indoor", "room")] = GeoDataPlacemark::IndoorRoom;
2034
2035 // Custom Marble OSM Tags
2036 s_visualCategories[OsmTag("marble_land", "landmass")] = GeoDataPlacemark::Landmass;
2037 s_visualCategories[OsmTag("settlement", "yes")] = GeoDataPlacemark::UrbanArea;
2038 s_visualCategories[OsmTag("marble_line", "date")] = GeoDataPlacemark::InternationalDateLine;
2039 s_visualCategories[OsmTag("marble:feature", "bathymetry")] = GeoDataPlacemark::Bathymetry;
2040
2041 // Default for buildings
2042 for (const auto &tag : buildingTags()) {
2043 s_visualCategories[tag] = GeoDataPlacemark::Building;
2044 }
2045}
2046
2047void StyleBuilder::Private::initializeMinimumZoomLevels()
2048{
2049 if (s_defaultMinZoomLevelsInitialized) {
2050 return;
2051 }
2052
2053 s_defaultMinZoomLevelsInitialized = true;
2054 for (int i = 0; i < GeoDataPlacemark::LastIndex; i++) {
2055 s_defaultMinZoomLevels[i] = -1;
2056 }
2057
2058 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel10] = 8;
2059 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel11] = 8;
2060 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel1] = 0;
2061 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel2] = 1;
2062 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel3] = 1;
2063 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel4] = 2;
2064 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel5] = 4;
2065 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel6] = 5;
2066 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel7] = 5;
2067 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel8] = 7;
2068 s_defaultMinZoomLevels[GeoDataPlacemark::AdminLevel9] = 7;
2069
2070 s_defaultMinZoomLevels[GeoDataPlacemark::HistoricArchaeologicalSite] = 16;
2071 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityBench] = 19;
2072 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityFountain] = 17;
2073 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityGraveyard] = 16;
2074 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityTelephone] = 17;
2075 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityKindergarten] = 16;
2076 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityLibrary] = 16;
2077 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityWasteBasket] = 19;
2078 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityToilets] = 17;
2079 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityTownHall] = 15;
2080 s_defaultMinZoomLevels[GeoDataPlacemark::LeisureWaterPark] = 15;
2081 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityDrinkingWater] = 17;
2082 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityEmbassy] = 15;
2083 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityEmergencyPhone] = 17;
2084 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityMountainRescue] = 16;
2085 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityCommunityCentre] = 17;
2086 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityFountain] = 17;
2087 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityNightClub] = 16;
2088 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityCourtHouse] = 16;
2089 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityFireStation] = 16;
2090 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityHuntingStand] = 17;
2091 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityPolice] = 16;
2092 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityPostBox] = 17;
2093 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityPostOffice] = 17;
2094 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityPrison] = 17;
2095 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityRecycling] = 17;
2096 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityShelter] = 17;
2097 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityChargingStation] = 17;
2098 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityCarWash] = 17;
2099 s_defaultMinZoomLevels[GeoDataPlacemark::AmenitySocialFacility] = 17;
2100
2101 s_defaultMinZoomLevels[GeoDataPlacemark::BarrierCityWall] = 15;
2102 s_defaultMinZoomLevels[GeoDataPlacemark::BarrierGate] = 17;
2103 s_defaultMinZoomLevels[GeoDataPlacemark::BarrierLiftGate] = 17;
2104 s_defaultMinZoomLevels[GeoDataPlacemark::BarrierWall] = 17;
2105
2106 s_defaultMinZoomLevels[GeoDataPlacemark::Bathymetry] = 1;
2107
2108 s_defaultMinZoomLevels[GeoDataPlacemark::BoundaryMaritime] = 1;
2109
2110 s_defaultMinZoomLevels[GeoDataPlacemark::Building] = 17;
2111
2112 s_defaultMinZoomLevels[GeoDataPlacemark::Default] = 1;
2113
2114 s_defaultMinZoomLevels[GeoDataPlacemark::EducationCollege] = 15;
2115 s_defaultMinZoomLevels[GeoDataPlacemark::EducationSchool] = 15;
2116 s_defaultMinZoomLevels[GeoDataPlacemark::EducationUniversity] = 15;
2117
2118 s_defaultMinZoomLevels[GeoDataPlacemark::FoodBar] = 16;
2119 s_defaultMinZoomLevels[GeoDataPlacemark::FoodBiergarten] = 16;
2120 s_defaultMinZoomLevels[GeoDataPlacemark::FoodCafe] = 16;
2121 s_defaultMinZoomLevels[GeoDataPlacemark::FoodFastFood] = 16;
2122 s_defaultMinZoomLevels[GeoDataPlacemark::FoodPub] = 16;
2123 s_defaultMinZoomLevels[GeoDataPlacemark::FoodRestaurant] = 16;
2124
2125 s_defaultMinZoomLevels[GeoDataPlacemark::HealthHospital] = 15;
2126 s_defaultMinZoomLevels[GeoDataPlacemark::HealthPharmacy] = 17;
2127 s_defaultMinZoomLevels[GeoDataPlacemark::HealthDentist] = 17;
2128 s_defaultMinZoomLevels[GeoDataPlacemark::HealthDoctors] = 17;
2129 s_defaultMinZoomLevels[GeoDataPlacemark::HealthVeterinary] = 17;
2130
2131 s_defaultMinZoomLevels[GeoDataPlacemark::HistoricMemorial] = 17;
2132
2133 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayCycleway] = 16;
2134 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayFootway] = 17;
2135 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayLivingStreet] = 15;
2136 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayMotorwayLink] = 10;
2137 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayMotorway] = 6;
2138 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayPath] = 13;
2139 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayPedestrian] = 13;
2140 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayPrimaryLink] = 10;
2141 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayPrimary] = 8;
2142 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayRaceway] = 12;
2143 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayResidential] = 14;
2144 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayRoad] = 13;
2145 s_defaultMinZoomLevels[GeoDataPlacemark::HighwaySecondaryLink] = 10;
2146 s_defaultMinZoomLevels[GeoDataPlacemark::HighwaySecondary] = 9;
2147 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayService] = 15;
2148 s_defaultMinZoomLevels[GeoDataPlacemark::HighwaySteps] = 15;
2149 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayTertiaryLink] = 10;
2150 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayTertiary] = 10;
2151 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayTrack] = 15;
2152 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayTrunkLink] = 10;
2153 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayTrunk] = 7;
2154 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayUnknown] = 16;
2155 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayUnclassified] = 16;
2156 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayTrafficSignals] = 17;
2157 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayCorridor] = 18;
2158 s_defaultMinZoomLevels[GeoDataPlacemark::HighwayElevator] = 17;
2159
2160 s_defaultMinZoomLevels[GeoDataPlacemark::AccomodationCamping] = 16;
2161 s_defaultMinZoomLevels[GeoDataPlacemark::AccomodationHostel] = 16;
2162 s_defaultMinZoomLevels[GeoDataPlacemark::AccomodationHotel] = 16;
2163 s_defaultMinZoomLevels[GeoDataPlacemark::AccomodationMotel] = 16;
2164 s_defaultMinZoomLevels[GeoDataPlacemark::AccomodationYouthHostel] = 16;
2165 s_defaultMinZoomLevels[GeoDataPlacemark::AccomodationGuestHouse] = 16;
2166
2167 s_defaultMinZoomLevels[GeoDataPlacemark::InternationalDateLine] = 1;
2168
2169 s_defaultMinZoomLevels[GeoDataPlacemark::Landmass] = 0;
2170
2171 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseAllotments] = 11;
2172 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseBasin] = 11;
2173 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseCemetery] = 11;
2174 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseCommercial] = 13;
2175 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseConstruction] = 11;
2176 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseFarmland] = 13;
2177 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseFarmyard] = 13;
2178 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseGarages] = 11;
2179 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseGrass] = 13;
2180 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseIndustrial] = 13;
2181 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseLandfill] = 11;
2182 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseMeadow] = 13;
2183 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseMilitary] = 11;
2184 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseOrchard] = 14;
2185 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseQuarry] = 11;
2186 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseRailway] = 11;
2187 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseReservoir] = 11;
2188 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseResidential] = 11;
2189 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseRetail] = 13;
2190 s_defaultMinZoomLevels[GeoDataPlacemark::LanduseVineyard] = 14;
2191
2192 s_defaultMinZoomLevels[GeoDataPlacemark::LeisureGolfCourse] = 15;
2193 s_defaultMinZoomLevels[GeoDataPlacemark::LeisureMarina] = 13;
2194 s_defaultMinZoomLevels[GeoDataPlacemark::LeisurePark] = 11;
2195 s_defaultMinZoomLevels[GeoDataPlacemark::LeisurePlayground] = 17;
2196 s_defaultMinZoomLevels[GeoDataPlacemark::LeisurePitch] = 15;
2197 s_defaultMinZoomLevels[GeoDataPlacemark::LeisureStadium] = 13;
2198 s_defaultMinZoomLevels[GeoDataPlacemark::LeisureSwimmingPool] = 17;
2199 s_defaultMinZoomLevels[GeoDataPlacemark::LeisureSportsCentre] = 15;
2200 s_defaultMinZoomLevels[GeoDataPlacemark::LeisureTrack] = 16;
2201 s_defaultMinZoomLevels[GeoDataPlacemark::LeisureMinigolfCourse] = 16;
2202
2203 s_defaultMinZoomLevels[GeoDataPlacemark::ManmadeBridge] = 15;
2204 s_defaultMinZoomLevels[GeoDataPlacemark::ManmadeLighthouse] = 15;
2205 s_defaultMinZoomLevels[GeoDataPlacemark::ManmadePier] = 15;
2206 s_defaultMinZoomLevels[GeoDataPlacemark::ManmadeWaterTower] = 15;
2207 s_defaultMinZoomLevels[GeoDataPlacemark::ManmadeWindMill] = 15;
2208 s_defaultMinZoomLevels[GeoDataPlacemark::ManmadeCommunicationsTower] = 15;
2209
2210 s_defaultMinZoomLevels[GeoDataPlacemark::MilitaryDangerArea] = 11;
2211
2212 s_defaultMinZoomLevels[GeoDataPlacemark::MoneyAtm] = 16;
2213 s_defaultMinZoomLevels[GeoDataPlacemark::MoneyBank] = 16;
2214
2215 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalBeach] = 13;
2216 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalCliff] = 15;
2217 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalGlacier] = 3;
2218 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalHeath] = 13;
2219 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalIceShelf] = 3;
2220 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalVolcano] = 13;
2221 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalPeak] = 11;
2222 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalReef] = 3;
2223 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalScrub] = 13;
2224 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalTree] = 17;
2225 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalCave] = 16;
2226 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalWater] = 3;
2227 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalWetland] = 10;
2228 s_defaultMinZoomLevels[GeoDataPlacemark::NaturalWood] = 8;
2229
2230 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceCityNationalCapital] = 9;
2231 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceCityCapital] = 9;
2232 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceCity] = 9;
2233 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceHamlet] = 15;
2234 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceLocality] = 15;
2235 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceSuburb] = 13;
2236 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceTownNationalCapital] = 11;
2237 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceTownCapital] = 11;
2238 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceTown] = 11;
2239 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceVillageNationalCapital] = 13;
2240 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceVillageCapital] = 13;
2241 s_defaultMinZoomLevels[GeoDataPlacemark::PlaceVillage] = 13;
2242
2243 s_defaultMinZoomLevels[GeoDataPlacemark::PowerTower] = 18;
2244
2245 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayAbandoned] = 10;
2246 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayConstruction] = 10;
2247 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayFunicular] = 13;
2248 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayLightRail] = 12;
2249 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayMiniature] = 16;
2250 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayMonorail] = 12;
2251 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayNarrowGauge] = 6;
2252 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayPreserved] = 13;
2253 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayRail] = 6;
2254 s_defaultMinZoomLevels[GeoDataPlacemark::RailwaySubway] = 13;
2255 s_defaultMinZoomLevels[GeoDataPlacemark::RailwayTram] = 14;
2256
2257 s_defaultMinZoomLevels[GeoDataPlacemark::Satellite] = 0;
2258
2259 for (int shop = GeoDataPlacemark::ShopBeverages; shop <= GeoDataPlacemark::Shop; ++shop) {
2260 s_defaultMinZoomLevels[shop] = 17;
2261 }
2262 s_defaultMinZoomLevels[GeoDataPlacemark::ShopSupermarket] = 16;
2263 s_defaultMinZoomLevels[GeoDataPlacemark::ShopDepartmentStore] = 16;
2264 s_defaultMinZoomLevels[GeoDataPlacemark::ShopDoitYourself] = 16;
2265
2266 s_defaultMinZoomLevels[GeoDataPlacemark::TourismAlpineHut] = 13;
2267 s_defaultMinZoomLevels[GeoDataPlacemark::TourismWildernessHut] = 13;
2268 s_defaultMinZoomLevels[GeoDataPlacemark::TourismAttraction] = 17;
2269 s_defaultMinZoomLevels[GeoDataPlacemark::TourismArtwork] = 17;
2270 s_defaultMinZoomLevels[GeoDataPlacemark::HistoricCastle] = 15;
2271 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityCinema] = 16;
2272 s_defaultMinZoomLevels[GeoDataPlacemark::TourismMuseum] = 16;
2273 s_defaultMinZoomLevels[GeoDataPlacemark::HistoricRuins] = 16;
2274 s_defaultMinZoomLevels[GeoDataPlacemark::AmenityTheatre] = 16;
2275 s_defaultMinZoomLevels[GeoDataPlacemark::TourismThemePark] = 15;
2276 s_defaultMinZoomLevels[GeoDataPlacemark::TourismViewPoint] = 15;
2277 s_defaultMinZoomLevels[GeoDataPlacemark::TourismZoo] = 15;
2278 s_defaultMinZoomLevels[GeoDataPlacemark::HistoricMonument] = 16;
2279 s_defaultMinZoomLevels[GeoDataPlacemark::TourismInformation] = 17;
2280 s_defaultMinZoomLevels[GeoDataPlacemark::TransportAerodrome] = 9;
2281 s_defaultMinZoomLevels[GeoDataPlacemark::TransportAirportApron] = 15;
2282 s_defaultMinZoomLevels[GeoDataPlacemark::TransportAirportRunway] = 15;
2283 s_defaultMinZoomLevels[GeoDataPlacemark::TransportAirportTaxiway] = 15;
2284 s_defaultMinZoomLevels[GeoDataPlacemark::TransportBusStation] = 15;
2285 s_defaultMinZoomLevels[GeoDataPlacemark::TransportCarShare] = 16;
2286 s_defaultMinZoomLevels[GeoDataPlacemark::TransportFuel] = 16;
2287 s_defaultMinZoomLevels[GeoDataPlacemark::TransportHelipad] = 16;
2288 s_defaultMinZoomLevels[GeoDataPlacemark::TransportAirportTerminal] = 17;
2289 s_defaultMinZoomLevels[GeoDataPlacemark::TransportAirportGate] = 17;
2290 s_defaultMinZoomLevels[GeoDataPlacemark::TransportPlatform] = 16;
2291 s_defaultMinZoomLevels[GeoDataPlacemark::TransportSpeedCamera] = 16;
2292 s_defaultMinZoomLevels[GeoDataPlacemark::TransportRentalCar] = 16;
2293 s_defaultMinZoomLevels[GeoDataPlacemark::TransportRentalBicycle] = 17;
2294 s_defaultMinZoomLevels[GeoDataPlacemark::TransportRentalSki] = 17;
2295 s_defaultMinZoomLevels[GeoDataPlacemark::TransportTaxiRank] = 16;
2296 s_defaultMinZoomLevels[GeoDataPlacemark::TransportParking] = 16;
2297 s_defaultMinZoomLevels[GeoDataPlacemark::TransportBusStop] = 16;
2298 s_defaultMinZoomLevels[GeoDataPlacemark::TransportTrainStation] = 13;
2299 s_defaultMinZoomLevels[GeoDataPlacemark::TransportTramStop] = 15;
2300 s_defaultMinZoomLevels[GeoDataPlacemark::TransportParkingSpace] = 17;
2301 s_defaultMinZoomLevels[GeoDataPlacemark::TransportBicycleParking] = 17;
2302 s_defaultMinZoomLevels[GeoDataPlacemark::TransportMotorcycleParking] = 17;
2303 s_defaultMinZoomLevels[GeoDataPlacemark::TransportSubwayEntrance] = 17;
2304
2305 for (int religion = GeoDataPlacemark::ReligionPlaceOfWorship; religion <= GeoDataPlacemark::ReligionTaoist; ++religion) {
2306 s_defaultMinZoomLevels[religion] = 17;
2307 }
2308
2309 s_defaultMinZoomLevels[GeoDataPlacemark::UrbanArea] = 3;
2310
2311 s_defaultMinZoomLevels[GeoDataPlacemark::WaterwayCanal] = 15;
2312 s_defaultMinZoomLevels[GeoDataPlacemark::WaterwayDitch] = 17;
2313 s_defaultMinZoomLevels[GeoDataPlacemark::WaterwayDrain] = 17;
2314 s_defaultMinZoomLevels[GeoDataPlacemark::WaterwayStream] = 15;
2315 s_defaultMinZoomLevels[GeoDataPlacemark::WaterwayRiver] = 3;
2316 s_defaultMinZoomLevels[GeoDataPlacemark::WaterwayWeir] = 17;
2317
2318 s_defaultMinZoomLevels[GeoDataPlacemark::CrossingIsland] = 18;
2319 s_defaultMinZoomLevels[GeoDataPlacemark::CrossingRailway] = 18;
2320 s_defaultMinZoomLevels[GeoDataPlacemark::CrossingSignals] = 18;
2321 s_defaultMinZoomLevels[GeoDataPlacemark::CrossingZebra] = 18;
2322
2323 s_defaultMinZoomLevels[GeoDataPlacemark::PisteDownhill] = 15;
2324 s_defaultMinZoomLevels[GeoDataPlacemark::PisteNordic] = 15;
2325 s_defaultMinZoomLevels[GeoDataPlacemark::PisteSkitour] = 15;
2326 s_defaultMinZoomLevels[GeoDataPlacemark::PisteSled] = 15;
2327 s_defaultMinZoomLevels[GeoDataPlacemark::PisteHike] = 15;
2328 s_defaultMinZoomLevels[GeoDataPlacemark::PisteSleigh] = 15;
2329 s_defaultMinZoomLevels[GeoDataPlacemark::PisteIceSkate] = 15;
2330 s_defaultMinZoomLevels[GeoDataPlacemark::PisteSnowPark] = 15;
2331 s_defaultMinZoomLevels[GeoDataPlacemark::PistePlayground] = 15;
2332 s_defaultMinZoomLevels[GeoDataPlacemark::PisteSkiJump] = 15;
2333
2334 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayStation] = 15;
2335 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayPylon] = 16;
2336 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayCableCar] = 15;
2337 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayGondola] = 15;
2338 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayChairLift] = 15;
2339 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayMixedLift] = 15;
2340 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayDragLift] = 15;
2341 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayTBar] = 15;
2342 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayJBar] = 15;
2343 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayPlatter] = 15;
2344 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayRopeTow] = 15;
2345 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayMagicCarpet] = 15;
2346 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayZipLine] = 15;
2347 s_defaultMinZoomLevels[GeoDataPlacemark::AerialwayGoods] = 15;
2348
2349 s_defaultMinZoomLevels[GeoDataPlacemark::IndoorDoor] = 17;
2350 s_defaultMinZoomLevels[GeoDataPlacemark::IndoorWall] = 17;
2351 s_defaultMinZoomLevels[GeoDataPlacemark::IndoorRoom] = 17;
2352
2353 for (int i = GeoDataPlacemark::PlaceCity; i < GeoDataPlacemark::LastIndex; i++) {
2354 if (s_defaultMinZoomLevels[i] < 0) {
2355 qDebug() << "Missing default min zoom level for GeoDataPlacemark::GeoDataVisualCategory " << i;
2356 Q_ASSERT(false && "StyleBuilder::Private::initializeMinimumZoomLevels is incomplete");
2357 s_defaultMinZoomLevels[i] = 15;
2358 }
2359 }
2360}
2361
2362StyleBuilder::StyleBuilder()
2363 : d(new Private)
2364{
2365 // nothing to do
2366}
2367
2368StyleBuilder::~StyleBuilder()
2369{
2370 delete d;
2371}
2372
2373QFont StyleBuilder::defaultFont() const
2374{
2375 return d->m_defaultFont;
2376}
2377
2378void StyleBuilder::setDefaultFont(const QFont &font)
2379{
2380 d->m_defaultFont = font;
2381 reset();
2382}
2383
2384QColor StyleBuilder::defaultLabelColor() const
2385{
2386 return d->m_defaultLabelColor;
2387}
2388
2389void StyleBuilder::setDefaultLabelColor(const QColor &color)
2390{
2391 d->m_defaultLabelColor = color;
2392 reset();
2393}
2394
2395GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &parameters) const
2396{
2397 const GeoDataPlacemark *const placemark = parameters.placemark;
2398
2399 if (!placemark) {
2400 Q_ASSERT(false && "Must not pass a null placemark to StyleBuilder::createStyle");
2401 return GeoDataStyle::Ptr();
2402 }
2403
2404 if (placemark->customStyle()) {
2405 return placemark->customStyle();
2406 }
2407
2408 if (parameters.relation) {
2409 auto style = d->createRelationStyle(parameters);
2410 if (style) {
2411 return style;
2412 }
2413 }
2414
2415 return d->createPlacemarkStyle(parameters);
2416}
2417
2418GeoDataStyle::ConstPtr StyleBuilder::Private::presetStyle(GeoDataPlacemark::GeoDataVisualCategory visualCategory) const
2419{
2420 if (!m_defaultStyleInitialized) {
2421 const_cast<StyleBuilder::Private *>(this)->initializeDefaultStyles(); // const cast due to lazy initialization
2422 }
2423
2424 if (m_defaultStyle[visualCategory]) {
2425 return m_defaultStyle[visualCategory];
2426 } else {
2427 return m_defaultStyle[GeoDataPlacemark::Default];
2428 }
2429}
2430
2431QStringList StyleBuilder::renderOrder() const
2432{
2433 static QStringList paintLayerOrder;
2434
2435 if (paintLayerOrder.isEmpty()) {
2436 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::Landmass);
2437 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::UrbanArea);
2438 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseResidential);
2439 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseAllotments);
2440 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseBasin);
2441 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseCemetery);
2442 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseCommercial);
2443 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseConstruction);
2444 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseFarmland);
2445 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseFarmyard);
2446 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseGarages);
2447 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseIndustrial);
2448 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseLandfill);
2449 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseMeadow);
2450 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseMilitary);
2451 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseQuarry);
2452 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseRailway);
2453 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseReservoir);
2454 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseRetail);
2455 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseOrchard);
2456 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseVineyard);
2457
2458 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::Bathymetry);
2459 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisureGolfCourse);
2460 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisureMinigolfCourse);
2461 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalBeach);
2462 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalWetland);
2463 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalGlacier);
2464 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalIceShelf);
2465 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalVolcano);
2466 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalCliff);
2467 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalPeak);
2468 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::MilitaryDangerArea);
2469 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisurePark);
2470 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisurePitch);
2471 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisureSportsCentre);
2472 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisureStadium);
2473 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalWood);
2474 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LanduseGrass);
2475 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::HighwayPedestrian);
2476 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisurePlayground);
2477 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalScrub);
2478 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisureTrack);
2479 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::TransportParking);
2480 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::TransportParkingSpace);
2481 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::ManmadeBridge);
2482 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::BarrierCityWall);
2483
2484 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::AmenityGraveyard);
2485
2486 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::AmenityKindergarten);
2487 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::EducationCollege);
2488 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::EducationSchool);
2489 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::EducationUniversity);
2490 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::HealthHospital);
2491 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisureSwimmingPool);
2492
2493 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::Landmass);
2494
2495 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::NaturalWater);
2496 for (int i = GeoDataPlacemark::WaterwayCanal; i <= GeoDataPlacemark::WaterwayStream; ++i) {
2497 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "outline");
2498 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "inline");
2499 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "label");
2500 }
2501
2502 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::NaturalReef, "outline");
2503 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::NaturalReef, "inline");
2504 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::NaturalReef, "label");
2505 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::LeisureMarina);
2506 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::ManmadePier);
2507 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::ManmadePier, "outline");
2508 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::ManmadePier, "inline");
2509 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::ManmadePier, "label");
2510
2511 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::TransportAirportApron);
2512
2513 for (int i = GeoDataPlacemark::HighwaySteps; i <= GeoDataPlacemark::HighwayMotorway; i++) {
2514 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "outline");
2515 }
2516 for (int i = GeoDataPlacemark::HighwaySteps; i <= GeoDataPlacemark::HighwayMotorway; i++) {
2517 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "inline");
2518 }
2519 for (int i = GeoDataPlacemark::RailwayRail; i <= GeoDataPlacemark::RailwayFunicular; i++) {
2520 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "outline");
2521 }
2522 for (int i = GeoDataPlacemark::RailwayRail; i <= GeoDataPlacemark::RailwayFunicular; i++) {
2523 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "inline");
2524 }
2525 // Highway labels shall appear on top of railways, hence here and not already above
2526 for (int i = GeoDataPlacemark::HighwaySteps; i <= GeoDataPlacemark::HighwayMotorway; i++) {
2527 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "label");
2528 }
2529 for (int i = GeoDataPlacemark::RailwayRail; i <= GeoDataPlacemark::RailwayFunicular; i++) {
2530 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "label");
2531 }
2532
2533 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::TransportPlatform);
2534 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::TransportPlatform, "outline");
2535 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::TransportPlatform, "inline");
2536 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::TransportPlatform, "label");
2537
2538 for (int i = GeoDataPlacemark::PisteDownhill; i <= GeoDataPlacemark::PisteSkiJump; ++i) {
2539 paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataPlacemark::GeoDataVisualCategory(i));
2540 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "outline");
2541 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "inline");
2542 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "label");
2543 }
2544 for (int i = GeoDataPlacemark::AerialwayCableCar; i <= GeoDataPlacemark::AerialwayGoods; ++i) {
2545 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "outline");
2546 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "inline");
2547 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "label");
2548 }
2549
2550 for (int i = GeoDataPlacemark::AdminLevel1; i <= GeoDataPlacemark::AdminLevel11; i++) {
2551 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "outline");
2552 }
2553 for (int i = GeoDataPlacemark::AdminLevel1; i <= GeoDataPlacemark::AdminLevel11; i++) {
2554 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "inline");
2555 }
2556 for (int i = GeoDataPlacemark::AdminLevel1; i <= GeoDataPlacemark::AdminLevel11; i++) {
2557 paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataPlacemark::GeoDataVisualCategory(i), "label");
2558 }
2559
2560 paintLayerOrder << QStringLiteral("Polygon/Building/frame");
2561 paintLayerOrder << QStringLiteral("Polygon/Building/roof");
2562
2563 paintLayerOrder << QStringLiteral("Photo");
2564
2565 // This assert checks that all the values in paintLayerOrder are unique.
2566 Q_ASSERT(QSet<QString>(paintLayerOrder.constBegin(), paintLayerOrder.constEnd()).size() == paintLayerOrder.size());
2567 }
2568
2569 return paintLayerOrder;
2570}
2571
2572void StyleBuilder::reset()
2573{
2574 d->m_defaultStyleInitialized = false;
2575}
2576
2577int StyleBuilder::minimumZoomLevel(const GeoDataPlacemark &placemark) const
2578{
2579 Q_ASSERT(Private::s_defaultMinZoomLevelsInitialized);
2580 return Private::s_defaultMinZoomLevels[placemark.visualCategory()];
2581}
2582
2583int StyleBuilder::minimumZoomLevel(const GeoDataPlacemark::GeoDataVisualCategory &visualCategory)
2584{
2585 Private::initializeMinimumZoomLevels();
2586 return Private::s_defaultMinZoomLevels[visualCategory];
2587}
2588
2589qint64 StyleBuilder::popularity(const GeoDataPlacemark *placemark)
2590{
2591 qint64 const defaultValue = 100;
2592 int const offset = 10;
2593 if (StyleBuilder::Private::s_popularities.isEmpty()) {
2595 popularities << GeoDataPlacemark::PlaceCityNationalCapital;
2596 popularities << GeoDataPlacemark::PlaceTownNationalCapital;
2597 popularities << GeoDataPlacemark::PlaceCityCapital;
2598 popularities << GeoDataPlacemark::PlaceTownCapital;
2599 popularities << GeoDataPlacemark::PlaceCity;
2600 popularities << GeoDataPlacemark::PlaceTown;
2601 popularities << GeoDataPlacemark::PlaceSuburb;
2602 popularities << GeoDataPlacemark::PlaceVillageNationalCapital;
2603 popularities << GeoDataPlacemark::PlaceVillageCapital;
2604 popularities << GeoDataPlacemark::PlaceVillage;
2605 popularities << GeoDataPlacemark::PlaceHamlet;
2606 popularities << GeoDataPlacemark::PlaceLocality;
2607
2608 popularities << GeoDataPlacemark::AmenityEmergencyPhone;
2609 popularities << GeoDataPlacemark::AmenityMountainRescue;
2610 popularities << GeoDataPlacemark::HealthHospital;
2611 popularities << GeoDataPlacemark::AmenityToilets;
2612 popularities << GeoDataPlacemark::MoneyAtm;
2613 popularities << GeoDataPlacemark::TransportSpeedCamera;
2614
2615 popularities << GeoDataPlacemark::NaturalPeak;
2616 popularities << GeoDataPlacemark::NaturalVolcano;
2617
2618 popularities << GeoDataPlacemark::AccomodationHotel;
2619 popularities << GeoDataPlacemark::AccomodationMotel;
2620 popularities << GeoDataPlacemark::AccomodationGuestHouse;
2621 popularities << GeoDataPlacemark::AccomodationYouthHostel;
2622 popularities << GeoDataPlacemark::AccomodationHostel;
2623 popularities << GeoDataPlacemark::AccomodationCamping;
2624
2625 popularities << GeoDataPlacemark::HealthDentist;
2626 popularities << GeoDataPlacemark::HealthDoctors;
2627 popularities << GeoDataPlacemark::HealthPharmacy;
2628 popularities << GeoDataPlacemark::HealthVeterinary;
2629
2630 popularities << GeoDataPlacemark::AmenityLibrary;
2631 popularities << GeoDataPlacemark::EducationCollege;
2632 popularities << GeoDataPlacemark::EducationSchool;
2633 popularities << GeoDataPlacemark::EducationUniversity;
2634
2635 popularities << GeoDataPlacemark::FoodBar;
2636 popularities << GeoDataPlacemark::FoodBiergarten;
2637 popularities << GeoDataPlacemark::FoodCafe;
2638 popularities << GeoDataPlacemark::FoodFastFood;
2639 popularities << GeoDataPlacemark::FoodPub;
2640 popularities << GeoDataPlacemark::FoodRestaurant;
2641
2642 popularities << GeoDataPlacemark::MoneyBank;
2643
2644 popularities << GeoDataPlacemark::HistoricArchaeologicalSite;
2645 popularities << GeoDataPlacemark::AmenityCarWash;
2646 popularities << GeoDataPlacemark::AmenityEmbassy;
2647 popularities << GeoDataPlacemark::LeisureWaterPark;
2648 popularities << GeoDataPlacemark::AmenityCommunityCentre;
2649 popularities << GeoDataPlacemark::AmenityFountain;
2650 popularities << GeoDataPlacemark::AmenityNightClub;
2651 popularities << GeoDataPlacemark::AmenityCourtHouse;
2652 popularities << GeoDataPlacemark::AmenityFireStation;
2653 popularities << GeoDataPlacemark::AmenityShelter;
2654 popularities << GeoDataPlacemark::AmenityHuntingStand;
2655 popularities << GeoDataPlacemark::AmenityPolice;
2656 popularities << GeoDataPlacemark::AmenityPostBox;
2657 popularities << GeoDataPlacemark::AmenityPostOffice;
2658 popularities << GeoDataPlacemark::AmenityPrison;
2659 popularities << GeoDataPlacemark::AmenityRecycling;
2660 popularities << GeoDataPlacemark::AmenitySocialFacility;
2661 popularities << GeoDataPlacemark::AmenityTelephone;
2662 popularities << GeoDataPlacemark::AmenityTownHall;
2663 popularities << GeoDataPlacemark::AmenityDrinkingWater;
2664 popularities << GeoDataPlacemark::AmenityGraveyard;
2665
2666 popularities << GeoDataPlacemark::ManmadeBridge;
2667 popularities << GeoDataPlacemark::ManmadeLighthouse;
2668 popularities << GeoDataPlacemark::ManmadePier;
2669 popularities << GeoDataPlacemark::ManmadeWaterTower;
2670 popularities << GeoDataPlacemark::ManmadeWindMill;
2671 popularities << GeoDataPlacemark::ManmadeCommunicationsTower;
2672
2673 popularities << GeoDataPlacemark::TourismAttraction;
2674 popularities << GeoDataPlacemark::TourismArtwork;
2675 popularities << GeoDataPlacemark::HistoricCastle;
2676 popularities << GeoDataPlacemark::AmenityCinema;
2677 popularities << GeoDataPlacemark::TourismInformation;
2678 popularities << GeoDataPlacemark::HistoricMonument;
2679 popularities << GeoDataPlacemark::TourismMuseum;
2680 popularities << GeoDataPlacemark::HistoricRuins;
2681 popularities << GeoDataPlacemark::AmenityTheatre;
2682 popularities << GeoDataPlacemark::TourismThemePark;
2683 popularities << GeoDataPlacemark::TourismViewPoint;
2684 popularities << GeoDataPlacemark::TourismZoo;
2685 popularities << GeoDataPlacemark::TourismAlpineHut;
2686 popularities << GeoDataPlacemark::TourismWildernessHut;
2687
2688 popularities << GeoDataPlacemark::HistoricMemorial;
2689
2690 popularities << GeoDataPlacemark::TransportAerodrome;
2691 popularities << GeoDataPlacemark::TransportHelipad;
2692 popularities << GeoDataPlacemark::TransportAirportTerminal;
2693 popularities << GeoDataPlacemark::TransportBusStation;
2694 popularities << GeoDataPlacemark::TransportBusStop;
2695 popularities << GeoDataPlacemark::TransportCarShare;
2696 popularities << GeoDataPlacemark::TransportFuel;
2697 popularities << GeoDataPlacemark::TransportParking;
2698 popularities << GeoDataPlacemark::TransportParkingSpace;
2699 popularities << GeoDataPlacemark::TransportPlatform;
2700 popularities << GeoDataPlacemark::TransportRentalBicycle;
2701 popularities << GeoDataPlacemark::TransportRentalCar;
2702 popularities << GeoDataPlacemark::TransportRentalSki;
2703 popularities << GeoDataPlacemark::TransportTaxiRank;
2704 popularities << GeoDataPlacemark::TransportTrainStation;
2705 popularities << GeoDataPlacemark::TransportTramStop;
2706 popularities << GeoDataPlacemark::TransportBicycleParking;
2707 popularities << GeoDataPlacemark::TransportMotorcycleParking;
2708 popularities << GeoDataPlacemark::TransportSubwayEntrance;
2709 popularities << GeoDataPlacemark::AerialwayStation;
2710
2711 popularities << GeoDataPlacemark::ShopBeverages;
2712 popularities << GeoDataPlacemark::ShopHifi;
2713 popularities << GeoDataPlacemark::ShopSupermarket;
2714 popularities << GeoDataPlacemark::ShopAlcohol;
2715 popularities << GeoDataPlacemark::ShopBakery;
2716 popularities << GeoDataPlacemark::ShopButcher;
2717 popularities << GeoDataPlacemark::ShopConfectionery;
2718 popularities << GeoDataPlacemark::ShopConvenience;
2719 popularities << GeoDataPlacemark::ShopGreengrocer;
2720 popularities << GeoDataPlacemark::ShopSeafood;
2721 popularities << GeoDataPlacemark::ShopDepartmentStore;
2722 popularities << GeoDataPlacemark::ShopKiosk;
2723 popularities << GeoDataPlacemark::ShopBag;
2724 popularities << GeoDataPlacemark::ShopClothes;
2725 popularities << GeoDataPlacemark::ShopFashion;
2726 popularities << GeoDataPlacemark::ShopJewelry;
2727 popularities << GeoDataPlacemark::ShopShoes;
2728 popularities << GeoDataPlacemark::ShopVarietyStore;
2729 popularities << GeoDataPlacemark::ShopBeauty;
2730 popularities << GeoDataPlacemark::ShopChemist;
2731 popularities << GeoDataPlacemark::ShopCosmetics;
2732 popularities << GeoDataPlacemark::ShopHairdresser;
2733 popularities << GeoDataPlacemark::ShopOptician;
2734 popularities << GeoDataPlacemark::ShopPerfumery;
2735 popularities << GeoDataPlacemark::ShopDoitYourself;
2736 popularities << GeoDataPlacemark::ShopFlorist;
2737 popularities << GeoDataPlacemark::ShopHardware;
2738 popularities << GeoDataPlacemark::ShopFurniture;
2739 popularities << GeoDataPlacemark::ShopElectronics;
2740 popularities << GeoDataPlacemark::ShopMobilePhone;
2741 popularities << GeoDataPlacemark::ShopBicycle;
2742 popularities << GeoDataPlacemark::ShopCar;
2743 popularities << GeoDataPlacemark::ShopCarRepair;
2744 popularities << GeoDataPlacemark::ShopCarParts;
2745 popularities << GeoDataPlacemark::ShopMotorcycle;
2746 popularities << GeoDataPlacemark::ShopOutdoor;
2747 popularities << GeoDataPlacemark::ShopSports;
2748 popularities << GeoDataPlacemark::ShopCopy;
2749 popularities << GeoDataPlacemark::ShopArt;
2750 popularities << GeoDataPlacemark::ShopMusicalInstrument;
2751 popularities << GeoDataPlacemark::ShopPhoto;
2752 popularities << GeoDataPlacemark::ShopBook;
2753 popularities << GeoDataPlacemark::ShopGift;
2754 popularities << GeoDataPlacemark::ShopStationery;
2755 popularities << GeoDataPlacemark::ShopLaundry;
2756 popularities << GeoDataPlacemark::ShopPet;
2757 popularities << GeoDataPlacemark::ShopToys;
2758 popularities << GeoDataPlacemark::ShopTravelAgency;
2759 popularities << GeoDataPlacemark::ShopDeli;
2760 popularities << GeoDataPlacemark::ShopTobacco;
2761 popularities << GeoDataPlacemark::ShopTea;
2762 popularities << GeoDataPlacemark::ShopComputer;
2763 popularities << GeoDataPlacemark::ShopGardenCentre;
2764 popularities << GeoDataPlacemark::Shop;
2765
2766 popularities << GeoDataPlacemark::LeisureGolfCourse;
2767 popularities << GeoDataPlacemark::LeisureMinigolfCourse;
2768 popularities << GeoDataPlacemark::LeisurePark;
2769 popularities << GeoDataPlacemark::LeisurePlayground;
2770 popularities << GeoDataPlacemark::LeisurePitch;
2771 popularities << GeoDataPlacemark::LeisureSportsCentre;
2772 popularities << GeoDataPlacemark::LeisureStadium;
2773 popularities << GeoDataPlacemark::LeisureTrack;
2774 popularities << GeoDataPlacemark::LeisureSwimmingPool;
2775
2776 popularities << GeoDataPlacemark::CrossingIsland;
2777 popularities << GeoDataPlacemark::CrossingRailway;
2778 popularities << GeoDataPlacemark::CrossingSignals;
2779 popularities << GeoDataPlacemark::CrossingZebra;
2780 popularities << GeoDataPlacemark::HighwayTrafficSignals;
2781 popularities << GeoDataPlacemark::HighwayElevator;
2782
2783 popularities << GeoDataPlacemark::BarrierGate;
2784 popularities << GeoDataPlacemark::BarrierLiftGate;
2785 popularities << GeoDataPlacemark::AmenityBench;
2786 popularities << GeoDataPlacemark::NaturalTree;
2787 popularities << GeoDataPlacemark::NaturalCave;
2788 popularities << GeoDataPlacemark::AmenityWasteBasket;
2789 popularities << GeoDataPlacemark::AerialwayPylon;
2790 popularities << GeoDataPlacemark::PowerTower;
2791
2792 int value = defaultValue + offset * popularities.size();
2793 for (auto popularity : std::as_const(popularities)) {
2794 StyleBuilder::Private::s_popularities[popularity] = value;
2795 value -= offset;
2796 }
2797 }
2798
2799 bool const isPrivate = placemark->osmData().containsTag(QStringLiteral("access"), QStringLiteral("private"));
2800 int const base = defaultValue + (isPrivate ? 0 : offset * StyleBuilder::Private::s_popularities.size());
2801 return base + StyleBuilder::Private::s_popularities.value(placemark->visualCategory(), defaultValue);
2802}
2803
2804int StyleBuilder::maximumZoomLevel() const
2805{
2806 return d->m_maximumZoomLevel;
2807}
2808
2809QString StyleBuilder::visualCategoryName(GeoDataPlacemark::GeoDataVisualCategory category)
2810{
2812
2813 if (visualCategoryNames.isEmpty()) {
2814 visualCategoryNames[GeoDataPlacemark::None] = "None";
2815 visualCategoryNames[GeoDataPlacemark::Default] = "Default";
2816 visualCategoryNames[GeoDataPlacemark::Unknown] = "Unknown";
2817 visualCategoryNames[GeoDataPlacemark::SmallCity] = "SmallCity";
2818 visualCategoryNames[GeoDataPlacemark::SmallCountyCapital] = "SmallCountyCapital";
2819 visualCategoryNames[GeoDataPlacemark::SmallStateCapital] = "SmallStateCapital";
2820 visualCategoryNames[GeoDataPlacemark::SmallNationCapital] = "SmallNationCapital";
2821 visualCategoryNames[GeoDataPlacemark::MediumCity] = "MediumCity";
2822 visualCategoryNames[GeoDataPlacemark::MediumCountyCapital] = "MediumCountyCapital";
2823 visualCategoryNames[GeoDataPlacemark::MediumStateCapital] = "MediumStateCapital";
2824 visualCategoryNames[GeoDataPlacemark::MediumNationCapital] = "MediumNationCapital";
2825 visualCategoryNames[GeoDataPlacemark::BigCity] = "BigCity";
2826 visualCategoryNames[GeoDataPlacemark::BigCountyCapital] = "BigCountyCapital";
2827 visualCategoryNames[GeoDataPlacemark::BigStateCapital] = "BigStateCapital";
2828 visualCategoryNames[GeoDataPlacemark::BigNationCapital] = "BigNationCapital";
2829 visualCategoryNames[GeoDataPlacemark::LargeCity] = "LargeCity";
2830 visualCategoryNames[GeoDataPlacemark::LargeCountyCapital] = "LargeCountyCapital";
2831 visualCategoryNames[GeoDataPlacemark::LargeStateCapital] = "LargeStateCapital";
2832 visualCategoryNames[GeoDataPlacemark::LargeNationCapital] = "LargeNationCapital";
2833 visualCategoryNames[GeoDataPlacemark::Nation] = "Nation";
2834 visualCategoryNames[GeoDataPlacemark::PlaceCity] = "PlaceCity";
2835 visualCategoryNames[GeoDataPlacemark::PlaceCityCapital] = "PlaceCityCapital";
2836 visualCategoryNames[GeoDataPlacemark::PlaceCityNationalCapital] = "PlaceCityNationalCapital";
2837 visualCategoryNames[GeoDataPlacemark::PlaceSuburb] = "PlaceSuburb";
2838 visualCategoryNames[GeoDataPlacemark::PlaceHamlet] = "PlaceHamlet";
2839 visualCategoryNames[GeoDataPlacemark::PlaceLocality] = "PlaceLocality";
2840 visualCategoryNames[GeoDataPlacemark::PlaceTown] = "PlaceTown";
2841 visualCategoryNames[GeoDataPlacemark::PlaceTownCapital] = "PlaceTownCapital";
2842 visualCategoryNames[GeoDataPlacemark::PlaceTownNationalCapital] = "PlaceTownNationalCapital";
2843 visualCategoryNames[GeoDataPlacemark::PlaceVillage] = "PlaceVillage";
2844 visualCategoryNames[GeoDataPlacemark::PlaceVillageCapital] = "PlaceVillageCapital";
2845 visualCategoryNames[GeoDataPlacemark::PlaceVillageNationalCapital] = "PlaceVillageNationalCapital";
2846 visualCategoryNames[GeoDataPlacemark::Mountain] = "Mountain";
2847 visualCategoryNames[GeoDataPlacemark::Volcano] = "Volcano";
2848 visualCategoryNames[GeoDataPlacemark::Mons] = "Mons";
2849 visualCategoryNames[GeoDataPlacemark::Valley] = "Valley";
2850 visualCategoryNames[GeoDataPlacemark::Continent] = "Continent";
2851 visualCategoryNames[GeoDataPlacemark::Ocean] = "Ocean";
2852 visualCategoryNames[GeoDataPlacemark::OtherTerrain] = "OtherTerrain";
2853 visualCategoryNames[GeoDataPlacemark::Crater] = "Crater";
2854 visualCategoryNames[GeoDataPlacemark::Mare] = "Mare";
2855 visualCategoryNames[GeoDataPlacemark::GeographicPole] = "GeographicPole";
2856 visualCategoryNames[GeoDataPlacemark::MagneticPole] = "MagneticPole";
2857 visualCategoryNames[GeoDataPlacemark::ShipWreck] = "ShipWreck";
2858 visualCategoryNames[GeoDataPlacemark::AirPort] = "AirPort";
2859 visualCategoryNames[GeoDataPlacemark::Observatory] = "Observatory";
2860 visualCategoryNames[GeoDataPlacemark::MilitaryDangerArea] = "MilitaryDangerArea";
2861 visualCategoryNames[GeoDataPlacemark::OsmSite] = "OsmSite";
2862 visualCategoryNames[GeoDataPlacemark::Coordinate] = "Coordinate";
2863 visualCategoryNames[GeoDataPlacemark::MannedLandingSite] = "MannedLandingSite";
2864 visualCategoryNames[GeoDataPlacemark::RoboticRover] = "RoboticRover";
2865 visualCategoryNames[GeoDataPlacemark::UnmannedSoftLandingSite] = "UnmannedSoftLandingSite";
2866 visualCategoryNames[GeoDataPlacemark::UnmannedHardLandingSite] = "UnmannedHardLandingSite";
2867 visualCategoryNames[GeoDataPlacemark::Bookmark] = "Bookmark";
2868 visualCategoryNames[GeoDataPlacemark::NaturalWater] = "NaturalWater";
2869 visualCategoryNames[GeoDataPlacemark::NaturalReef] = "NaturalReef";
2870 visualCategoryNames[GeoDataPlacemark::NaturalWood] = "NaturalWood";
2871 visualCategoryNames[GeoDataPlacemark::NaturalBeach] = "NaturalBeach";
2872 visualCategoryNames[GeoDataPlacemark::NaturalWetland] = "NaturalWetland";
2873 visualCategoryNames[GeoDataPlacemark::NaturalGlacier] = "NaturalGlacier";
2874 visualCategoryNames[GeoDataPlacemark::NaturalIceShelf] = "NaturalIceShelf";
2875 visualCategoryNames[GeoDataPlacemark::NaturalScrub] = "NaturalScrub";
2876 visualCategoryNames[GeoDataPlacemark::NaturalCliff] = "NaturalCliff";
2877 visualCategoryNames[GeoDataPlacemark::NaturalHeath] = "NaturalHeath";
2878 visualCategoryNames[GeoDataPlacemark::HighwayTrafficSignals] = "HighwayTrafficSignals";
2879 visualCategoryNames[GeoDataPlacemark::HighwaySteps] = "HighwaySteps";
2880 visualCategoryNames[GeoDataPlacemark::HighwayUnknown] = "HighwayUnknown";
2881 visualCategoryNames[GeoDataPlacemark::HighwayPath] = "HighwayPath";
2882 visualCategoryNames[GeoDataPlacemark::HighwayFootway] = "HighwayFootway";
2883 visualCategoryNames[GeoDataPlacemark::HighwayTrack] = "HighwayTrack";
2884 visualCategoryNames[GeoDataPlacemark::HighwayPedestrian] = "HighwayPedestrian";
2885 visualCategoryNames[GeoDataPlacemark::HighwayCycleway] = "HighwayCycleway";
2886 visualCategoryNames[GeoDataPlacemark::HighwayService] = "HighwayService";
2887 visualCategoryNames[GeoDataPlacemark::HighwayRoad] = "HighwayRoad";
2888 visualCategoryNames[GeoDataPlacemark::HighwayResidential] = "HighwayResidential";
2889 visualCategoryNames[GeoDataPlacemark::HighwayLivingStreet] = "HighwayLivingStreet";
2890 visualCategoryNames[GeoDataPlacemark::HighwayUnclassified] = "HighwayUnclassified";
2891 visualCategoryNames[GeoDataPlacemark::HighwayTertiaryLink] = "HighwayTertiaryLink";
2892 visualCategoryNames[GeoDataPlacemark::HighwayTertiary] = "HighwayTertiary";
2893 visualCategoryNames[GeoDataPlacemark::HighwaySecondaryLink] = "HighwaySecondaryLink";
2894 visualCategoryNames[GeoDataPlacemark::HighwaySecondary] = "HighwaySecondary";
2895 visualCategoryNames[GeoDataPlacemark::HighwayPrimaryLink] = "HighwayPrimaryLink";
2896 visualCategoryNames[GeoDataPlacemark::HighwayPrimary] = "HighwayPrimary";
2897 visualCategoryNames[GeoDataPlacemark::HighwayRaceway] = "HighwayRaceway";
2898 visualCategoryNames[GeoDataPlacemark::HighwayTrunkLink] = "HighwayTrunkLink";
2899 visualCategoryNames[GeoDataPlacemark::HighwayTrunk] = "HighwayTrunk";
2900 visualCategoryNames[GeoDataPlacemark::HighwayMotorwayLink] = "HighwayMotorwayLink";
2901 visualCategoryNames[GeoDataPlacemark::HighwayMotorway] = "HighwayMotorway";
2902 visualCategoryNames[GeoDataPlacemark::HighwayCorridor] = "HighwayCorridor";
2903 visualCategoryNames[GeoDataPlacemark::HighwayElevator] = "HighwayElevator";
2904 visualCategoryNames[GeoDataPlacemark::Building] = "Building";
2905 visualCategoryNames[GeoDataPlacemark::AccomodationCamping] = "AccomodationCamping";
2906 visualCategoryNames[GeoDataPlacemark::AccomodationHostel] = "AccomodationHostel";
2907 visualCategoryNames[GeoDataPlacemark::AccomodationHotel] = "AccomodationHotel";
2908 visualCategoryNames[GeoDataPlacemark::AccomodationMotel] = "AccomodationMotel";
2909 visualCategoryNames[GeoDataPlacemark::AccomodationYouthHostel] = "AccomodationYouthHostel";
2910 visualCategoryNames[GeoDataPlacemark::AccomodationGuestHouse] = "AccomodationGuestHouse";
2911 visualCategoryNames[GeoDataPlacemark::AmenityLibrary] = "AmenityLibrary";
2912 visualCategoryNames[GeoDataPlacemark::AmenityKindergarten] = "AmenityKindergarten";
2913 visualCategoryNames[GeoDataPlacemark::EducationCollege] = "EducationCollege";
2914 visualCategoryNames[GeoDataPlacemark::EducationSchool] = "EducationSchool";
2915 visualCategoryNames[GeoDataPlacemark::EducationUniversity] = "EducationUniversity";
2916 visualCategoryNames[GeoDataPlacemark::FoodBar] = "FoodBar";
2917 visualCategoryNames[GeoDataPlacemark::FoodBiergarten] = "FoodBiergarten";
2918 visualCategoryNames[GeoDataPlacemark::FoodCafe] = "FoodCafe";
2919 visualCategoryNames[GeoDataPlacemark::FoodFastFood] = "FoodFastFood";
2920 visualCategoryNames[GeoDataPlacemark::FoodPub] = "FoodPub";
2921 visualCategoryNames[GeoDataPlacemark::FoodRestaurant] = "FoodRestaurant";
2922 visualCategoryNames[GeoDataPlacemark::HealthDentist] = "HealthDentist";
2923 visualCategoryNames[GeoDataPlacemark::HealthDoctors] = "HealthDoctors";
2924 visualCategoryNames[GeoDataPlacemark::HealthHospital] = "HealthHospital";
2925 visualCategoryNames[GeoDataPlacemark::HealthPharmacy] = "HealthPharmacy";
2926 visualCategoryNames[GeoDataPlacemark::HealthVeterinary] = "HealthVeterinary";
2927 visualCategoryNames[GeoDataPlacemark::MoneyAtm] = "MoneyAtm";
2928 visualCategoryNames[GeoDataPlacemark::MoneyBank] = "MoneyBank";
2929 visualCategoryNames[GeoDataPlacemark::AmenityEmbassy] = "AmenityEmbassy";
2930 visualCategoryNames[GeoDataPlacemark::AmenityEmergencyPhone] = "AmenityEmergencyPhone";
2931 visualCategoryNames[GeoDataPlacemark::AmenityMountainRescue] = "AmenityMountainRescue";
2932 visualCategoryNames[GeoDataPlacemark::LeisureWaterPark] = "LeisureWaterPark";
2933 visualCategoryNames[GeoDataPlacemark::AmenityCommunityCentre] = "AmenityCommunityCentre";
2934 visualCategoryNames[GeoDataPlacemark::AmenityFountain] = "AmenityFountain";
2935 visualCategoryNames[GeoDataPlacemark::AmenityNightClub] = "AmenityNightClub";
2936 visualCategoryNames[GeoDataPlacemark::AmenityBench] = "AmenityBench";
2937 visualCategoryNames[GeoDataPlacemark::AmenityCourtHouse] = "AmenityCourtHouse";
2938 visualCategoryNames[GeoDataPlacemark::AmenityFireStation] = "AmenityFireStation";
2939 visualCategoryNames[GeoDataPlacemark::AmenityHuntingStand] = "AmenityHuntingStand";
2940 visualCategoryNames[GeoDataPlacemark::AmenityPolice] = "AmenityPolice";
2941 visualCategoryNames[GeoDataPlacemark::AmenityPostBox] = "AmenityPostBox";
2942 visualCategoryNames[GeoDataPlacemark::AmenityPostOffice] = "AmenityPostOffice";
2943 visualCategoryNames[GeoDataPlacemark::AmenityPrison] = "AmenityPrison";
2944 visualCategoryNames[GeoDataPlacemark::AmenityRecycling] = "AmenityRecycling";
2945 visualCategoryNames[GeoDataPlacemark::AmenityShelter] = "AmenityShelter";
2946 visualCategoryNames[GeoDataPlacemark::AmenityTelephone] = "AmenityTelephone";
2947 visualCategoryNames[GeoDataPlacemark::AmenityToilets] = "AmenityToilets";
2948 visualCategoryNames[GeoDataPlacemark::AmenityTownHall] = "AmenityTownHall";
2949 visualCategoryNames[GeoDataPlacemark::AmenityWasteBasket] = "AmenityWasteBasket";
2950 visualCategoryNames[GeoDataPlacemark::AmenityDrinkingWater] = "AmenityDrinkingWater";
2951 visualCategoryNames[GeoDataPlacemark::AmenityGraveyard] = "AmenityGraveyard";
2952 visualCategoryNames[GeoDataPlacemark::AmenityChargingStation] = "ChargingStation";
2953 visualCategoryNames[GeoDataPlacemark::AmenityCarWash] = "CarWash";
2954 visualCategoryNames[GeoDataPlacemark::AmenitySocialFacility] = "SocialFacility";
2955 visualCategoryNames[GeoDataPlacemark::BarrierCityWall] = "BarrierCityWall";
2956 visualCategoryNames[GeoDataPlacemark::BarrierGate] = "BarrierGate";
2957 visualCategoryNames[GeoDataPlacemark::BarrierLiftGate] = "BarrierLiftGate";
2958 visualCategoryNames[GeoDataPlacemark::BarrierWall] = "BarrierWall";
2959 visualCategoryNames[GeoDataPlacemark::NaturalVolcano] = "NaturalVolcano";
2960 visualCategoryNames[GeoDataPlacemark::NaturalPeak] = "NaturalPeak";
2961 visualCategoryNames[GeoDataPlacemark::NaturalTree] = "NaturalTree";
2962 visualCategoryNames[GeoDataPlacemark::NaturalCave] = "NaturalCave";
2963 visualCategoryNames[GeoDataPlacemark::ShopBeverages] = "ShopBeverages";
2964 visualCategoryNames[GeoDataPlacemark::ShopHifi] = "ShopHifi";
2965 visualCategoryNames[GeoDataPlacemark::ShopSupermarket] = "ShopSupermarket";
2966 visualCategoryNames[GeoDataPlacemark::ShopAlcohol] = "ShopAlcohol";
2967 visualCategoryNames[GeoDataPlacemark::ShopBakery] = "ShopBakery";
2968 visualCategoryNames[GeoDataPlacemark::ShopButcher] = "ShopButcher";
2969 visualCategoryNames[GeoDataPlacemark::ShopConfectionery] = "ShopConfectionery";
2970 visualCategoryNames[GeoDataPlacemark::ShopConvenience] = "ShopConvenience";
2971 visualCategoryNames[GeoDataPlacemark::ShopGreengrocer] = "ShopGreengrocer";
2972 visualCategoryNames[GeoDataPlacemark::ShopSeafood] = "ShopSeafood";
2973 visualCategoryNames[GeoDataPlacemark::ShopDepartmentStore] = "ShopDepartmentStore";
2974 visualCategoryNames[GeoDataPlacemark::ShopKiosk] = "ShopKiosk";
2975 visualCategoryNames[GeoDataPlacemark::ShopBag] = "ShopBag";
2976 visualCategoryNames[GeoDataPlacemark::ShopClothes] = "ShopClothes";
2977 visualCategoryNames[GeoDataPlacemark::ShopFashion] = "ShopFashion";
2978 visualCategoryNames[GeoDataPlacemark::ShopJewelry] = "ShopJewelry";
2979 visualCategoryNames[GeoDataPlacemark::ShopShoes] = "ShopShoes";
2980 visualCategoryNames[GeoDataPlacemark::ShopVarietyStore] = "ShopVarietyStore";
2981 visualCategoryNames[GeoDataPlacemark::ShopBeauty] = "ShopBeauty";
2982 visualCategoryNames[GeoDataPlacemark::ShopChemist] = "ShopChemist";
2983 visualCategoryNames[GeoDataPlacemark::ShopCosmetics] = "ShopCosmetics";
2984 visualCategoryNames[GeoDataPlacemark::ShopHairdresser] = "ShopHairdresser";
2985 visualCategoryNames[GeoDataPlacemark::ShopOptician] = "ShopOptician";
2986 visualCategoryNames[GeoDataPlacemark::ShopPerfumery] = "ShopPerfumery";
2987 visualCategoryNames[GeoDataPlacemark::ShopDoitYourself] = "ShopDoitYourself";
2988 visualCategoryNames[GeoDataPlacemark::ShopFlorist] = "ShopFlorist";
2989 visualCategoryNames[GeoDataPlacemark::ShopHardware] = "ShopHardware";
2990 visualCategoryNames[GeoDataPlacemark::ShopFurniture] = "ShopFurniture";
2991 visualCategoryNames[GeoDataPlacemark::ShopElectronics] = "ShopElectronics";
2992 visualCategoryNames[GeoDataPlacemark::ShopMobilePhone] = "ShopMobilePhone";
2993 visualCategoryNames[GeoDataPlacemark::ShopBicycle] = "ShopBicycle";
2994 visualCategoryNames[GeoDataPlacemark::ShopCar] = "ShopCar";
2995 visualCategoryNames[GeoDataPlacemark::ShopCarRepair] = "ShopCarRepair";
2996 visualCategoryNames[GeoDataPlacemark::ShopCarParts] = "ShopCarParts";
2997 visualCategoryNames[GeoDataPlacemark::ShopMotorcycle] = "ShopMotorcycle";
2998 visualCategoryNames[GeoDataPlacemark::ShopOutdoor] = "ShopOutdoor";
2999 visualCategoryNames[GeoDataPlacemark::ShopSports] = "ShopSports";
3000 visualCategoryNames[GeoDataPlacemark::ShopCopy] = "ShopCopy";
3001 visualCategoryNames[GeoDataPlacemark::ShopArt] = "ShopArt";
3002 visualCategoryNames[GeoDataPlacemark::ShopMusicalInstrument] = "ShopMusicalInstrument";
3003 visualCategoryNames[GeoDataPlacemark::ShopPhoto] = "ShopPhoto";
3004 visualCategoryNames[GeoDataPlacemark::ShopBook] = "ShopBook";
3005 visualCategoryNames[GeoDataPlacemark::ShopGift] = "ShopGift";
3006 visualCategoryNames[GeoDataPlacemark::ShopStationery] = "ShopStationery";
3007 visualCategoryNames[GeoDataPlacemark::ShopLaundry] = "ShopLaundry";
3008 visualCategoryNames[GeoDataPlacemark::ShopPet] = "ShopPet";
3009 visualCategoryNames[GeoDataPlacemark::ShopToys] = "ShopToys";
3010 visualCategoryNames[GeoDataPlacemark::ShopTravelAgency] = "ShopTravelAgency";
3011 visualCategoryNames[GeoDataPlacemark::ShopDeli] = "ShopDeli";
3012 visualCategoryNames[GeoDataPlacemark::ShopTobacco] = "ShopTobacco";
3013 visualCategoryNames[GeoDataPlacemark::ShopTea] = "ShopTea";
3014 visualCategoryNames[GeoDataPlacemark::ShopComputer] = "ShopComputer";
3015 visualCategoryNames[GeoDataPlacemark::ShopGardenCentre] = "ShopGardenCentre";
3016 visualCategoryNames[GeoDataPlacemark::Shop] = "Shop";
3017 visualCategoryNames[GeoDataPlacemark::ManmadeBridge] = "ManmadeBridge";
3018 visualCategoryNames[GeoDataPlacemark::ManmadeLighthouse] = "ManmadeLighthouse";
3019 visualCategoryNames[GeoDataPlacemark::ManmadePier] = "ManmadePier";
3020 visualCategoryNames[GeoDataPlacemark::ManmadeWaterTower] = "ManmadeWaterTower";
3021 visualCategoryNames[GeoDataPlacemark::ManmadeWindMill] = "ManmadeWindMill";
3022 visualCategoryNames[GeoDataPlacemark::ManmadeCommunicationsTower] = "ManmadeCommunicationsTower";
3023 visualCategoryNames[GeoDataPlacemark::TourismAttraction] = "TouristAttraction";
3024 visualCategoryNames[GeoDataPlacemark::TourismArtwork] = "TouristArtwork";
3025 visualCategoryNames[GeoDataPlacemark::HistoricArchaeologicalSite] = "HistoricArchaeologicalSite";
3026 visualCategoryNames[GeoDataPlacemark::HistoricCastle] = "HistoricCastle";
3027 visualCategoryNames[GeoDataPlacemark::HistoricMemorial] = "HistoricMemorial";
3028 visualCategoryNames[GeoDataPlacemark::HistoricMonument] = "HistoricMonument";
3029 visualCategoryNames[GeoDataPlacemark::AmenityCinema] = "TouristCinema";
3030 visualCategoryNames[GeoDataPlacemark::TourismInformation] = "TouristInformation";
3031 visualCategoryNames[GeoDataPlacemark::TourismMuseum] = "TouristMuseum";
3032 visualCategoryNames[GeoDataPlacemark::HistoricRuins] = "TouristRuin";
3033 visualCategoryNames[GeoDataPlacemark::AmenityTheatre] = "TouristTheatre";
3034 visualCategoryNames[GeoDataPlacemark::TourismThemePark] = "TouristThemePark";
3035 visualCategoryNames[GeoDataPlacemark::TourismViewPoint] = "TouristViewPoint";
3036 visualCategoryNames[GeoDataPlacemark::TourismZoo] = "TouristZoo";
3037 visualCategoryNames[GeoDataPlacemark::TourismAlpineHut] = "TouristAlpineHut";
3038 visualCategoryNames[GeoDataPlacemark::TourismWildernessHut] = "TouristWildernessHut";
3039 visualCategoryNames[GeoDataPlacemark::TransportAerodrome] = "TransportAerodrome";
3040 visualCategoryNames[GeoDataPlacemark::TransportHelipad] = "TransportHelipad";
3041 visualCategoryNames[GeoDataPlacemark::TransportAirportTerminal] = "TransportAirportTerminal";
3042 visualCategoryNames[GeoDataPlacemark::TransportAirportGate] = "TransportAirportGate";
3043 visualCategoryNames[GeoDataPlacemark::TransportAirportRunway] = "TransportAirportRunway";
3044 visualCategoryNames[GeoDataPlacemark::TransportAirportTaxiway] = "TransportAirportTaxiway";
3045 visualCategoryNames[GeoDataPlacemark::TransportAirportApron] = "TransportAirportApron";
3046 visualCategoryNames[GeoDataPlacemark::TransportBusStation] = "TransportBusStation";
3047 visualCategoryNames[GeoDataPlacemark::TransportBusStop] = "TransportBusStop";
3048 visualCategoryNames[GeoDataPlacemark::TransportCarShare] = "TransportCarShare";
3049 visualCategoryNames[GeoDataPlacemark::TransportFuel] = "TransportFuel";
3050 visualCategoryNames[GeoDataPlacemark::TransportParking] = "TransportParking";
3051 visualCategoryNames[GeoDataPlacemark::TransportParkingSpace] = "TransportParkingSpace";
3052 visualCategoryNames[GeoDataPlacemark::TransportPlatform] = "TransportPlatform";
3053 visualCategoryNames[GeoDataPlacemark::TransportRentalBicycle] = "TransportRentalBicycle";
3054 visualCategoryNames[GeoDataPlacemark::TransportRentalCar] = "TransportRentalCar";
3055 visualCategoryNames[GeoDataPlacemark::TransportRentalSki] = "TransportRentalSki";
3056 visualCategoryNames[GeoDataPlacemark::TransportTaxiRank] = "TransportTaxiRank";
3057 visualCategoryNames[GeoDataPlacemark::TransportTrainStation] = "TransportTrainStation";
3058 visualCategoryNames[GeoDataPlacemark::TransportTramStop] = "TransportTramStop";
3059 visualCategoryNames[GeoDataPlacemark::TransportSpeedCamera] = "TransportSpeedCamera";
3060 visualCategoryNames[GeoDataPlacemark::TransportBicycleParking] = "TransportBicycleParking";
3061 visualCategoryNames[GeoDataPlacemark::TransportMotorcycleParking] = "TransportMotorcycleParking";
3062 visualCategoryNames[GeoDataPlacemark::TransportSubwayEntrance] = "TransportSubwayEntrance";
3063 visualCategoryNames[GeoDataPlacemark::ReligionPlaceOfWorship] = "ReligionPlaceOfWorship";
3064 visualCategoryNames[GeoDataPlacemark::ReligionBahai] = "ReligionBahai";
3065 visualCategoryNames[GeoDataPlacemark::ReligionBuddhist] = "ReligionBuddhist";
3066 visualCategoryNames[GeoDataPlacemark::ReligionChristian] = "ReligionChristian";
3067 visualCategoryNames[GeoDataPlacemark::ReligionMuslim] = "ReligionMuslim";
3068 visualCategoryNames[GeoDataPlacemark::ReligionHindu] = "ReligionHindu";
3069 visualCategoryNames[GeoDataPlacemark::ReligionJain] = "ReligionJain";
3070 visualCategoryNames[GeoDataPlacemark::ReligionJewish] = "ReligionJewish";
3071 visualCategoryNames[GeoDataPlacemark::ReligionShinto] = "ReligionShinto";
3072 visualCategoryNames[GeoDataPlacemark::ReligionSikh] = "ReligionSikh";
3073 visualCategoryNames[GeoDataPlacemark::ReligionTaoist] = "ReligionTaoist";
3074 visualCategoryNames[GeoDataPlacemark::LeisureGolfCourse] = "LeisureGolfCourse";
3075 visualCategoryNames[GeoDataPlacemark::LeisureMarina] = "LeisureMarina";
3076 visualCategoryNames[GeoDataPlacemark::LeisurePark] = "LeisurePark";
3077 visualCategoryNames[GeoDataPlacemark::LeisurePlayground] = "LeisurePlayground";
3078 visualCategoryNames[GeoDataPlacemark::LeisurePitch] = "LeisurePitch";
3079 visualCategoryNames[GeoDataPlacemark::LeisureSportsCentre] = "LeisureSportsCentre";
3080 visualCategoryNames[GeoDataPlacemark::LeisureStadium] = "LeisureStadium";
3081 visualCategoryNames[GeoDataPlacemark::LeisureTrack] = "LeisureTrack";
3082 visualCategoryNames[GeoDataPlacemark::LeisureSwimmingPool] = "LeisureSwimmingPool";
3083 visualCategoryNames[GeoDataPlacemark::LeisureMinigolfCourse] = "LeisureMinigolfCourse";
3084 visualCategoryNames[GeoDataPlacemark::LanduseAllotments] = "LanduseAllotments";
3085 visualCategoryNames[GeoDataPlacemark::LanduseBasin] = "LanduseBasin";
3086 visualCategoryNames[GeoDataPlacemark::LanduseCemetery] = "LanduseCemetery";
3087 visualCategoryNames[GeoDataPlacemark::LanduseCommercial] = "LanduseCommercial";
3088 visualCategoryNames[GeoDataPlacemark::LanduseConstruction] = "LanduseConstruction";
3089 visualCategoryNames[GeoDataPlacemark::LanduseFarmland] = "LanduseFarmland";
3090 visualCategoryNames[GeoDataPlacemark::LanduseFarmyard] = "LanduseFarmyard";
3091 visualCategoryNames[GeoDataPlacemark::LanduseGarages] = "LanduseGarages";
3092 visualCategoryNames[GeoDataPlacemark::LanduseGrass] = "LanduseGrass";
3093 visualCategoryNames[GeoDataPlacemark::LanduseIndustrial] = "LanduseIndustrial";
3094 visualCategoryNames[GeoDataPlacemark::LanduseLandfill] = "LanduseLandfill";
3095 visualCategoryNames[GeoDataPlacemark::LanduseMeadow] = "LanduseMeadow";
3096 visualCategoryNames[GeoDataPlacemark::LanduseMilitary] = "LanduseMilitary";
3097 visualCategoryNames[GeoDataPlacemark::LanduseQuarry] = "LanduseQuarry";
3098 visualCategoryNames[GeoDataPlacemark::LanduseRailway] = "LanduseRailway";
3099 visualCategoryNames[GeoDataPlacemark::LanduseReservoir] = "LanduseReservoir";
3100 visualCategoryNames[GeoDataPlacemark::LanduseResidential] = "LanduseResidential";
3101 visualCategoryNames[GeoDataPlacemark::LanduseRetail] = "LanduseRetail";
3102 visualCategoryNames[GeoDataPlacemark::LanduseOrchard] = "LanduseOrchard";
3103 visualCategoryNames[GeoDataPlacemark::LanduseVineyard] = "LanduseVineyard";
3104 visualCategoryNames[GeoDataPlacemark::RailwayRail] = "RailwayRail";
3105 visualCategoryNames[GeoDataPlacemark::RailwayNarrowGauge] = "RailwayNarrowGauge";
3106 visualCategoryNames[GeoDataPlacemark::RailwayTram] = "RailwayTram";
3107 visualCategoryNames[GeoDataPlacemark::RailwayLightRail] = "RailwayLightRail";
3108 visualCategoryNames[GeoDataPlacemark::RailwayAbandoned] = "RailwayAbandoned";
3109 visualCategoryNames[GeoDataPlacemark::RailwaySubway] = "RailwaySubway";
3110 visualCategoryNames[GeoDataPlacemark::RailwayPreserved] = "RailwayPreserved";
3111 visualCategoryNames[GeoDataPlacemark::RailwayMiniature] = "RailwayMiniature";
3112 visualCategoryNames[GeoDataPlacemark::RailwayConstruction] = "RailwayConstruction";
3113 visualCategoryNames[GeoDataPlacemark::RailwayMonorail] = "RailwayMonorail";
3114 visualCategoryNames[GeoDataPlacemark::RailwayFunicular] = "RailwayFunicular";
3115 visualCategoryNames[GeoDataPlacemark::PowerTower] = "PowerTower";
3116 visualCategoryNames[GeoDataPlacemark::AerialwayStation] = "AerialwayStation";
3117 visualCategoryNames[GeoDataPlacemark::AerialwayPylon] = "AerialwayPylon";
3118 visualCategoryNames[GeoDataPlacemark::AerialwayCableCar] = "AerialwayCableCar";
3119 visualCategoryNames[GeoDataPlacemark::AerialwayGondola] = "AerialwayGondola";
3120 visualCategoryNames[GeoDataPlacemark::AerialwayChairLift] = "AerialwayChairLift";
3121 visualCategoryNames[GeoDataPlacemark::AerialwayMixedLift] = "AerialwayMixedLift";
3122 visualCategoryNames[GeoDataPlacemark::AerialwayDragLift] = "AerialwayDragLift";
3123 visualCategoryNames[GeoDataPlacemark::AerialwayTBar] = "AerialwayTBar";
3124 visualCategoryNames[GeoDataPlacemark::AerialwayJBar] = "AerialwayJBar";
3125 visualCategoryNames[GeoDataPlacemark::AerialwayPlatter] = "AerialwayPlatter";
3126 visualCategoryNames[GeoDataPlacemark::AerialwayRopeTow] = "AerialwayRopeTow";
3127 visualCategoryNames[GeoDataPlacemark::AerialwayMagicCarpet] = "AerialwayMagicCarpet";
3128 visualCategoryNames[GeoDataPlacemark::AerialwayZipLine] = "AerialwayZipLine";
3129 visualCategoryNames[GeoDataPlacemark::AerialwayGoods] = "AerialwayGoods";
3130 visualCategoryNames[GeoDataPlacemark::PisteDownhill] = "PisteDownhill";
3131 visualCategoryNames[GeoDataPlacemark::PisteNordic] = "PisteNordic";
3132 visualCategoryNames[GeoDataPlacemark::PisteSkitour] = "PisteSkitour";
3133 visualCategoryNames[GeoDataPlacemark::PisteSled] = "PisteSled";
3134 visualCategoryNames[GeoDataPlacemark::PisteHike] = "PisteHike";
3135 visualCategoryNames[GeoDataPlacemark::PisteSleigh] = "PisteSleigh";
3136 visualCategoryNames[GeoDataPlacemark::PisteIceSkate] = "PisteIceSkate";
3137 visualCategoryNames[GeoDataPlacemark::PisteSnowPark] = "PisteSnowPark";
3138 visualCategoryNames[GeoDataPlacemark::PistePlayground] = "PistePlayground";
3139 visualCategoryNames[GeoDataPlacemark::PisteSkiJump] = "PisteSkiJump";
3140 visualCategoryNames[GeoDataPlacemark::Satellite] = "Satellite";
3141 visualCategoryNames[GeoDataPlacemark::Landmass] = "Landmass";
3142 visualCategoryNames[GeoDataPlacemark::UrbanArea] = "UrbanArea";
3143 visualCategoryNames[GeoDataPlacemark::InternationalDateLine] = "InternationalDateLine";
3144 visualCategoryNames[GeoDataPlacemark::Bathymetry] = "Bathymetry";
3145 visualCategoryNames[GeoDataPlacemark::AdminLevel1] = "AdminLevel1";
3146 visualCategoryNames[GeoDataPlacemark::AdminLevel2] = "AdminLevel2";
3147 visualCategoryNames[GeoDataPlacemark::AdminLevel3] = "AdminLevel3";
3148 visualCategoryNames[GeoDataPlacemark::AdminLevel4] = "AdminLevel4";
3149 visualCategoryNames[GeoDataPlacemark::AdminLevel5] = "AdminLevel5";
3150 visualCategoryNames[GeoDataPlacemark::AdminLevel6] = "AdminLevel6";
3151 visualCategoryNames[GeoDataPlacemark::AdminLevel7] = "AdminLevel7";
3152 visualCategoryNames[GeoDataPlacemark::AdminLevel8] = "AdminLevel8";
3153 visualCategoryNames[GeoDataPlacemark::AdminLevel9] = "AdminLevel9";
3154 visualCategoryNames[GeoDataPlacemark::AdminLevel10] = "AdminLevel10";
3155 visualCategoryNames[GeoDataPlacemark::AdminLevel11] = "AdminLevel11";
3156 visualCategoryNames[GeoDataPlacemark::BoundaryMaritime] = "BoundaryMaritime";
3157 visualCategoryNames[GeoDataPlacemark::WaterwayCanal] = "WaterwayCanal";
3158 visualCategoryNames[GeoDataPlacemark::WaterwayDitch] = "WaterwayDitch";
3159 visualCategoryNames[GeoDataPlacemark::WaterwayDrain] = "WaterwayDrain";
3160 visualCategoryNames[GeoDataPlacemark::WaterwayStream] = "WaterwayStream";
3161 visualCategoryNames[GeoDataPlacemark::WaterwayRiver] = "WaterwayRiver";
3162 visualCategoryNames[GeoDataPlacemark::WaterwayWeir] = "WaterwayWeir";
3163 visualCategoryNames[GeoDataPlacemark::CrossingIsland] = "CrossingIsland";
3164 visualCategoryNames[GeoDataPlacemark::CrossingRailway] = "CrossingRailway";
3165 visualCategoryNames[GeoDataPlacemark::CrossingSignals] = "CrossingSignals";
3166 visualCategoryNames[GeoDataPlacemark::CrossingZebra] = "CrossingZebra";
3167 visualCategoryNames[GeoDataPlacemark::IndoorDoor] = "IndoorDoor";
3168 visualCategoryNames[GeoDataPlacemark::IndoorWall] = "IndoorWall";
3169 visualCategoryNames[GeoDataPlacemark::IndoorRoom] = "IndoorRoom";
3170 visualCategoryNames[GeoDataPlacemark::LastIndex] = "LastIndex";
3171 }
3172
3173 Q_ASSERT(visualCategoryNames.contains(category));
3174 return visualCategoryNames[category];
3175}
3176
3177QColor StyleBuilder::effectColor(const QColor &color)
3178{
3179 return Private::effectColor(color);
3180}
3181
3182StyleEffect StyleBuilder::styleEffect()
3183{
3184 return Private::s_styleEffect;
3185}
3186
3187void StyleBuilder::setStyleEffect(StyleEffect effect)
3188{
3189 Private::s_styleEffect = effect;
3190}
3191
3193{
3194 Private::initializeOsmVisualCategories();
3195 return Private::s_visualCategories;
3196}
3197
3198QStringList StyleBuilder::shopValues()
3199{
3200 // from https://taginfo.openstreetmap.org/keys/building#values
3201 static const QStringList osmShopValues = QStringList() << "cheese"
3202 << "chocolate"
3203 << "coffee"
3204 << "dairy"
3205 << "farm"
3206 << "pasta"
3207 << "pastry"
3208 << "wine"
3209 << "general"
3210 << "mall"
3211 << "baby_goods"
3212 << "boutique"
3213 << "fabric"
3214 << "leather"
3215 << "tailor"
3216 << "watches"
3217 << "charity"
3218 << "second_hand"
3219 << "erotic"
3220 << "hearing_aids"
3221 << "herbalist"
3222 << "massage"
3223 << "medical_supply"
3224 << "tattoo"
3225 << "bathroom_furnishing"
3226 << "electrical"
3227 << "energy"
3228 << "furnace"
3229 << "garden_furniture"
3230 << "gas"
3231 << "glaziery"
3232 << "houseware"
3233 << "locksmith"
3234 << "paint"
3235 << "trade"
3236 << "antiques"
3237 << "bed"
3238 << "candles"
3239 << "carpet"
3240 << "curtain"
3241 << "interior_decoration"
3242 << "kitchen"
3243 << "lamps"
3244 << "window_blind"
3245 << "radiotechnics"
3246 << "vacuum_cleaner"
3247 << "fishing"
3248 << "free_flying"
3249 << "hunting"
3250 << "outdoor"
3251 << "scuba_diving"
3252 << "sports"
3253 << "tyres"
3254 << "swimming_pool"
3255 << "art"
3256 << "craft"
3257 << "frame"
3258 << "games"
3259 << "model"
3260 << "music"
3261 << "trophy"
3262 << "video"
3263 << "video_games"
3264 << "anime"
3265 << "ticket"
3266 << "copyshop"
3267 << "dry_cleaning"
3268 << "e-cigarette"
3269 << "funeral_directors"
3270 << "money_lender"
3271 << "pawnbroker"
3272 << "pyrotechnics"
3273 << "religion"
3274 << "storage_rental"
3275 << "weapons"
3276 << "user defined";
3277
3278 return osmShopValues;
3279}
3280
3281QSet<StyleBuilder::OsmTag> StyleBuilder::buildingTags()
3282{
3283 static const QString building = QStringLiteral("building");
3284 // from https://taginfo.openstreetmap.org/keys/building#values
3285 static const QSet<OsmTag> osmBuildingTags = QSet<OsmTag>()
3286 << OsmTag(building, "yes") << OsmTag(building, "house") << OsmTag(building, "residential") << OsmTag(building, "garage")
3287 << OsmTag(building, "apartments") << OsmTag(building, "hut") << OsmTag(building, "industrial") << OsmTag(building, "detached")
3288 << OsmTag(building, "roof") << OsmTag(building, "garages") << OsmTag(building, "commercial") << OsmTag(building, "terrace") << OsmTag(building, "shed")
3289 << OsmTag(building, "school") << OsmTag(building, "retail") << OsmTag(building, "farm_auxiliary") << OsmTag(building, "church")
3290 << OsmTag(building, "cathedral") << OsmTag(building, "greenhouse") << OsmTag(building, "barn") << OsmTag(building, "service")
3291 << OsmTag(building, "manufacture") << OsmTag(building, "construction") << OsmTag(building, "cabin") << OsmTag(building, "farm")
3292 << OsmTag(building, "warehouse") << OsmTag(building, "House") << OsmTag(building, "office") << OsmTag(building, "civic")
3293 << OsmTag(building, "Residential") << OsmTag(building, "hangar") << OsmTag(building, "public") << OsmTag(building, "university")
3294 << OsmTag(building, "hospital") << OsmTag(building, "chapel") << OsmTag(building, "hotel") << OsmTag(building, "train_station")
3295 << OsmTag(building, "dormitory") << OsmTag(building, "kindergarten") << OsmTag(building, "stable") << OsmTag(building, "storage_tank")
3296 << OsmTag(building, "shop") << OsmTag(building, "college") << OsmTag(building, "supermarket") << OsmTag(building, "factory")
3297 << OsmTag(building, "bungalow") << OsmTag(building, "tower") << OsmTag(building, "silo") << OsmTag(building, "storage") << OsmTag(building, "station")
3298 << OsmTag(building, "education") << OsmTag(building, "carport") << OsmTag(building, "houseboat") << OsmTag(building, "castle")
3299 << OsmTag(building, "social_facility") << OsmTag(building, "water_tower") << OsmTag(building, "container") << OsmTag(building, "exhibition_hall")
3300 << OsmTag(building, "monastery") << OsmTag(building, "bunker") << OsmTag(building, "shelter") << OsmTag("building:part", "yes")
3301 << OsmTag("building:part", "antenna");
3302
3303 return osmBuildingTags;
3304}
3305
3306GeoDataPlacemark::GeoDataVisualCategory StyleBuilder::determineVisualCategory(const OsmPlacemarkData &osmData)
3307{
3308 QString const yes(QStringLiteral("yes"));
3309 if (osmData.containsTagKey(QStringLiteral("area:highway")) || // Not supported yet
3310 osmData.containsTag(QStringLiteral("boundary"), QStringLiteral("protected_area")) || // Not relevant for the default map
3311 osmData.containsTag(QStringLiteral("boundary"), QStringLiteral("postal_code"))
3312 || osmData.containsTag(QStringLiteral("boundary"), QStringLiteral("aerial_views")) || // Created by OSM editor(s) application for digitalization
3313 osmData.containsTagKey(QStringLiteral("closed:highway")) || osmData.containsTagKey(QStringLiteral("abandoned:highway"))
3314 || osmData.containsTagKey(QStringLiteral("abandoned:natural")) || osmData.containsTagKey(QStringLiteral("abandoned:building"))
3315 || osmData.containsTagKey(QStringLiteral("abandoned:leisure")) || osmData.containsTagKey(QStringLiteral("disused:highway"))
3316 || osmData.containsTag(QStringLiteral("highway"), QStringLiteral("razed")) || osmData.containsTag(QStringLiteral("piste:abandoned"), yes)) {
3317 return GeoDataPlacemark::None;
3318 }
3319
3320 if (osmData.containsTag(QStringLiteral("building"), yes)) {
3321 return GeoDataPlacemark::Building;
3322 }
3323
3324 if (osmData.containsTag(QStringLiteral("historic"), QStringLiteral("castle"))
3325 && osmData.containsTag(QStringLiteral("castle_type"), QStringLiteral("kremlin"))) {
3326 return GeoDataPlacemark::None;
3327 }
3328
3329 if (osmData.containsTag(QStringLiteral("natural"), QStringLiteral("glacier"))
3330 && osmData.containsTag(QStringLiteral("glacier:type"), QStringLiteral("shelf"))) {
3331 return GeoDataPlacemark::NaturalIceShelf;
3332 }
3333
3334 if (osmData.containsTag(QStringLiteral("highway"), QStringLiteral("crossing"))) {
3335 QStringList const crossings = osmData.tagValue(QStringLiteral("crossing")).split(';');
3336 QString const crossingRef = osmData.tagValue(QStringLiteral("crossing_ref"));
3337 if (crossingRef == QStringLiteral("zebra") || crossingRef == QStringLiteral("tiger") || crossings.contains(QStringLiteral("zebra"))
3338 || crossings.contains(QStringLiteral("tiger"))) {
3339 return GeoDataPlacemark::CrossingZebra;
3340 } else if (crossingRef == QStringLiteral("toucan") || crossingRef == QStringLiteral("pelican") || crossings.contains(QStringLiteral("traffic_signals"))
3341 || crossings.contains(QStringLiteral("toucan")) || crossings.contains(QStringLiteral("pelican"))) {
3342 return GeoDataPlacemark::CrossingSignals;
3343 } else if (crossings.contains(QStringLiteral("island"))) {
3344 return GeoDataPlacemark::CrossingIsland;
3345 }
3346 }
3347 if (osmData.containsTag(QStringLiteral("railway"), QStringLiteral("crossing"))
3348 || osmData.containsTag(QStringLiteral("railway"), QStringLiteral("level_crossing"))) {
3349 return GeoDataPlacemark::CrossingRailway;
3350 }
3351
3352 Private::initializeOsmVisualCategories();
3353
3354 auto const pisteType = osmData.tagValue(QStringLiteral("piste:type"));
3355 if (!pisteType.isEmpty()) {
3356 auto const tag = OsmTag(QStringLiteral("piste:type"), pisteType);
3357 auto category = Private::s_visualCategories.value(tag, GeoDataPlacemark::None);
3358 if (category != GeoDataPlacemark::None) {
3359 return category;
3360 }
3361 }
3362
3363 QString const capital(QStringLiteral("capital"));
3364 QString const admin_level(QStringLiteral("admin_level"));
3365 // National capitals have admin_level=2
3366 // More at https://wiki.openstreetmap.org/wiki/Key:capital#Using_relations_for_capitals
3367 QString const national_level(QStringLiteral("2"));
3368
3369 for (auto iter = osmData.tagsBegin(), end = osmData.tagsEnd(); iter != end; ++iter) {
3370 const auto tag = OsmTag(iter.key(), iter.value());
3371 GeoDataPlacemark::GeoDataVisualCategory category = Private::s_visualCategories.value(tag, GeoDataPlacemark::None);
3372 if (category != GeoDataPlacemark::None) {
3373 if (category == GeoDataPlacemark::PlaceCity && osmData.containsTag(admin_level, national_level)) {
3374 category = GeoDataPlacemark::PlaceCityNationalCapital;
3375 } else if (category == GeoDataPlacemark::PlaceCity && osmData.containsTag(capital, yes)) {
3376 category = GeoDataPlacemark::PlaceCityCapital;
3377 } else if (category == GeoDataPlacemark::PlaceTown && osmData.containsTag(admin_level, national_level)) {
3378 category = GeoDataPlacemark::PlaceTownNationalCapital;
3379 } else if (category == GeoDataPlacemark::PlaceTown && osmData.containsTag(capital, yes)) {
3380 category = GeoDataPlacemark::PlaceTownCapital;
3381 } else if (category == GeoDataPlacemark::PlaceVillage && osmData.containsTag(admin_level, national_level)) {
3382 category = GeoDataPlacemark::PlaceVillageNationalCapital;
3383 } else if (category == GeoDataPlacemark::PlaceVillage && osmData.containsTag(capital, yes)) {
3384 category = GeoDataPlacemark::PlaceVillageCapital;
3385 }
3386 }
3387
3388 if (category != GeoDataPlacemark::None) {
3389 return category;
3390 }
3391 }
3392
3393 return GeoDataPlacemark::None;
3394}
3395
3396StyleParameters::StyleParameters(const GeoDataPlacemark *placemark_, int tileLevel_)
3397 : placemark(placemark_)
3398 , tileLevel(tileLevel_)
3399 , relation(nullptr)
3400{
3401 // nothing to do
3402}
3403
3404}
GeoDataVisualCategory
A categorization of a placemark as defined by ...FIXME.
KGUIADDONS_EXPORT qreal hue(const QColor &)
QString path(const QString &relativePath)
KREPORT_EXPORT QPageSize::PageSizeId defaultSize()
KGuiItem reset()
Category category(StandardShortcut id)
KI18NLOCALEDATA_EXPORT KCountry country(const char *ianaId)
Binds a QML item to a specific geodetic location in screen coordinates.
int blue() const const
QColor darker(int factor) const const
void getHsvF(float *h, float *s, float *v, float *a) const const
int green() const const
bool isValidColorName(QAnyStringView name)
int red() const const
QRgb rgb() const const
void setHsvF(float h, float s, float v, float a)
QDate currentDate()
int month() const const
AbsoluteSpacing
void setBold(bool enable)
void setCapitalization(Capitalization caps)
void setLetterSpacing(SpacingType type, qreal spacing)
void setPointSize(int pointSize)
void setUnderline(bool enable)
QList< QScreen * > screens()
bool contains(const Key &key) const const
bool isEmpty() const const
qsizetype size() const const
T value(const Key &key) const const
const_iterator constBegin() const const
const_iterator constEnd() const const
bool isEmpty() const const
qsizetype size() const const
Country country() const const
QLocale system()
qsizetype size() const const
QString arg(Args &&... args) const const
bool isEmpty() const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
float toFloat(bool *ok) const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
BrushStyle
PenCapStyle
PenStyle
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.