diff --git a/src/lib/marble/PlacemarkLayout.cpp b/src/lib/marble/PlacemarkLayout.cpp index 84cbdac29..5433013bd 100644 --- a/src/lib/marble/PlacemarkLayout.cpp +++ b/src/lib/marble/PlacemarkLayout.cpp @@ -1,709 +1,710 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2006-2007 Torsten Rahn // Copyright 2007-2008 Inge Wallin // Copyright 2010-2012 Bernhard Beschow // #include "PlacemarkLayout.h" #include #include #include #include #include #include #include #include #include "GeoDataPlacemark.h" #include "GeoDataStyle.h" #include "GeoDataTypes.h" #include "OsmPlacemarkData.h" #include "MarbleDebug.h" #include "MarbleGlobal.h" #include "PlacemarkLayer.h" #include "MarbleClock.h" #include "MarblePlacemarkModel.h" #include "MarbleDirs.h" #include "ViewportParams.h" #include "TileId.h" #include "TileCoordsPyramid.h" #include "VisiblePlacemark.h" #include "MathHelper.h" #include namespace { //Helper function that checks for available room for the label bool hasRoomFor(const QVector & placemarks, const QRectF &labelRect) { // Check if there is another label or symbol that overlaps. QVector::const_iterator beforeItEnd = placemarks.constEnd(); for ( QVector::ConstIterator beforeIt = placemarks.constBegin(); beforeIt != beforeItEnd; ++beforeIt ) { if ( labelRect.intersects( (*beforeIt)->labelRect() ) ) { return false; } } return true; } } namespace Marble { QSet acceptedVisualCategories() { QSet visualCategories; visualCategories << GeoDataFeature::SmallCity << GeoDataFeature::SmallCountyCapital << GeoDataFeature::SmallStateCapital << GeoDataFeature::SmallNationCapital << GeoDataFeature::MediumCity << GeoDataFeature::MediumCountyCapital << GeoDataFeature::MediumStateCapital << GeoDataFeature::MediumNationCapital << GeoDataFeature::BigCity << GeoDataFeature::BigCountyCapital << GeoDataFeature::BigStateCapital << GeoDataFeature::BigNationCapital << GeoDataFeature::LargeCity << GeoDataFeature::LargeCountyCapital << GeoDataFeature::LargeStateCapital << GeoDataFeature::LargeNationCapital << GeoDataFeature::Nation << GeoDataFeature::Mountain << GeoDataFeature::Volcano << GeoDataFeature::Mons << GeoDataFeature::Valley << GeoDataFeature::Continent << GeoDataFeature::Ocean << GeoDataFeature::OtherTerrain << GeoDataFeature::Crater << GeoDataFeature::Mare << GeoDataFeature::GeographicPole << GeoDataFeature::MagneticPole << GeoDataFeature::ShipWreck << GeoDataFeature::LeisureMarina << GeoDataFeature::AirPort << GeoDataFeature::Observatory << GeoDataFeature::AccomodationCamping << GeoDataFeature::AccomodationHostel << GeoDataFeature::AccomodationHotel << GeoDataFeature::AccomodationMotel << GeoDataFeature::AccomodationYouthHostel << GeoDataFeature::AmenityLibrary << GeoDataFeature::AmenityKindergarten << GeoDataFeature::EducationCollege << GeoDataFeature::EducationSchool << GeoDataFeature::EducationUniversity << GeoDataFeature::FoodBar << GeoDataFeature::FoodBiergarten << GeoDataFeature::FoodCafe << GeoDataFeature::FoodFastFood << GeoDataFeature::FoodPub << GeoDataFeature::FoodRestaurant << GeoDataFeature::HealthDoctors << GeoDataFeature::HealthHospital << GeoDataFeature::HealthPharmacy << GeoDataFeature::MoneyBank << GeoDataFeature::NaturalPeak << GeoDataFeature::ShopBeverages << GeoDataFeature::ShopHifi << GeoDataFeature::ShopSupermarket << GeoDataFeature::TouristAlpineHut << GeoDataFeature::TouristAttraction << GeoDataFeature::TouristCastle << GeoDataFeature::TouristCinema << GeoDataFeature::TouristMonument << GeoDataFeature::TouristMuseum << GeoDataFeature::TouristRuin << GeoDataFeature::TouristTheatre << GeoDataFeature::TouristThemePark << GeoDataFeature::TouristViewPoint << GeoDataFeature::TouristZoo << GeoDataFeature::TransportAerodrome << GeoDataFeature::TransportAirportTerminal << GeoDataFeature::TransportAirportGate << GeoDataFeature::TransportAirportRunway + << GeoDataFeature::TransportAirportTaxiway << GeoDataFeature::TransportBusStation << GeoDataFeature::TransportBusStop << GeoDataFeature::TransportCarShare << GeoDataFeature::TransportFuel << GeoDataFeature::TransportParking << GeoDataFeature::TransportTrainStation << GeoDataFeature::ReligionPlaceOfWorship << GeoDataFeature::ReligionBahai << GeoDataFeature::ReligionBuddhist << GeoDataFeature::ReligionChristian << GeoDataFeature::ReligionHindu << GeoDataFeature::ReligionJain << GeoDataFeature::ReligionJewish << GeoDataFeature::ReligionShinto << GeoDataFeature::ReligionSikh; return visualCategories; } PlacemarkLayout::PlacemarkLayout( QAbstractItemModel *placemarkModel, QItemSelectionModel *selectionModel, MarbleClock *clock, const StyleBuilder *styleBuilder, QObject* parent ) : QObject( parent ), m_placemarkModel(placemarkModel), m_selectionModel( selectionModel ), m_clock( clock ), m_acceptedVisualCategories( acceptedVisualCategories() ), m_showPlaces( false ), m_showCities( false ), m_showTerrain( false ), m_showOtherPlaces( false ), m_showLandingSites( false ), m_showCraters( false ), m_showMaria( false ), m_maxLabelHeight(maxLabelHeight()), m_styleResetRequested( true ), m_styleBuilder(styleBuilder) { Q_ASSERT(m_placemarkModel); connect( m_selectionModel, SIGNAL( selectionChanged( QItemSelection, QItemSelection) ), this, SLOT(requestStyleReset()) ); connect( m_placemarkModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(resetCacheData()) ); connect( m_placemarkModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(addPlacemarks(QModelIndex,int,int)) ); connect( m_placemarkModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, SLOT(removePlacemarks(QModelIndex,int,int)) ); connect( m_placemarkModel, SIGNAL(modelReset()), this, SLOT(resetCacheData()) ); } PlacemarkLayout::~PlacemarkLayout() { styleReset(); } void PlacemarkLayout::setShowPlaces( bool show ) { m_showPlaces = show; } void PlacemarkLayout::setShowCities( bool show ) { m_showCities = show; } void PlacemarkLayout::setShowTerrain( bool show ) { m_showTerrain = show; } void PlacemarkLayout::setShowOtherPlaces( bool show ) { m_showOtherPlaces = show; } void PlacemarkLayout::setShowLandingSites( bool show ) { m_showLandingSites = show; } void PlacemarkLayout::setShowCraters( bool show ) { m_showCraters = show; } void PlacemarkLayout::setShowMaria( bool show ) { m_showMaria = show; } void PlacemarkLayout::requestStyleReset() { mDebug() << "Style reset requested."; m_styleResetRequested = true; } void PlacemarkLayout::styleReset() { m_paintOrder.clear(); m_labelArea = 0; qDeleteAll( m_visiblePlacemarks ); m_visiblePlacemarks.clear(); m_maxLabelHeight = maxLabelHeight(); m_styleResetRequested = false; } QVector PlacemarkLayout::whichPlacemarkAt( const QPoint& curpos ) { if ( m_styleResetRequested ) { styleReset(); } QVector ret; foreach( VisiblePlacemark* mark, m_paintOrder ) { if ( mark->labelRect().contains( curpos ) || QRect( mark->symbolPosition(), mark->symbolPixmap().size() ).contains( curpos ) ) { ret.append( mark->placemark() ); } } return ret; } int PlacemarkLayout::maxLabelHeight() const { QFont const standardFont(QStringLiteral("Arial")); return QFontMetrics(standardFont).height(); } /// feed an internal QMap of placemarks with TileId as key when model changes void PlacemarkLayout::addPlacemarks( const QModelIndex& parent, int first, int last ) { Q_ASSERT( first < m_placemarkModel->rowCount() ); Q_ASSERT( last < m_placemarkModel->rowCount() ); for( int i=first; i<=last; ++i ) { QModelIndex index = m_placemarkModel->index( i, 0, parent ); Q_ASSERT( index.isValid() ); const GeoDataPlacemark *placemark = static_cast(qvariant_cast(index.data( MarblePlacemarkModel::ObjectPointerRole ) )); const GeoDataCoordinates coordinates = placemarkIconCoordinates( placemark ); if ( !coordinates.isValid() ) { continue; } if (placemark->hasOsmData()) { qint64 const osmId = placemark->osmData().id(); if (osmId > 0) { if (m_osmIds.contains(osmId)) { continue; // placemark is already shown } m_osmIds << osmId; } } int zoomLevel = placemark->zoomLevel(); TileId key = TileId::fromCoordinates( coordinates, zoomLevel ); m_placemarkCache[key].append( placemark ); } emit repaintNeeded(); } void PlacemarkLayout::removePlacemarks( const QModelIndex& parent, int first, int last ) { Q_ASSERT( first < m_placemarkModel->rowCount() ); Q_ASSERT( last < m_placemarkModel->rowCount() ); for( int i=first; i<=last; ++i ) { QModelIndex index = m_placemarkModel->index( i, 0, parent ); Q_ASSERT( index.isValid() ); const GeoDataPlacemark *placemark = static_cast(qvariant_cast( index.data( MarblePlacemarkModel::ObjectPointerRole ) )); const GeoDataCoordinates coordinates = placemarkIconCoordinates( placemark ); if ( !coordinates.isValid() ) { continue; } int zoomLevel = placemark->zoomLevel(); TileId key = TileId::fromCoordinates( coordinates, zoomLevel ); m_placemarkCache[key].removeAll( placemark ); if (placemark->hasOsmData()) { qint64 const osmId = placemark->osmData().id(); if (osmId > 0) { m_osmIds.remove(osmId); } } } emit repaintNeeded(); } void PlacemarkLayout::resetCacheData() { const int rowCount = m_placemarkModel->rowCount(); m_osmIds.clear(); m_placemarkCache.clear(); requestStyleReset(); addPlacemarks( m_placemarkModel->index( 0, 0 ), 0, rowCount ); emit repaintNeeded(); } QSet PlacemarkLayout::visibleTiles( const ViewportParams *viewport ) { int zoomLevel = qLn( viewport->radius() *4 / 256 ) / qLn( 2.0 ); /* * rely on m_placemarkCache to find the placemarks for the tiles which * matter. The top level tiles have the more popular placemarks, * the bottom level tiles have the smaller ones, and we only get the ones * matching our latLonAltBox. */ qreal north, south, east, west; viewport->viewLatLonAltBox().boundaries(north, south, east, west); QSet tileIdSet; QVector geoRects; if( west <= east ) { geoRects << QRectF(west, north, east - west, south - north); } else { geoRects << QRectF(west, north, M_PI - west, south - north); geoRects << QRectF(-M_PI, north, east + M_PI, south - north); } foreach( const QRectF &geoRect, geoRects ) { TileId key; QRect rect; key = TileId::fromCoordinates( GeoDataCoordinates(geoRect.left(), north, 0), zoomLevel); rect.setLeft( key.x() ); rect.setTop( key.y() ); key = TileId::fromCoordinates( GeoDataCoordinates(geoRect.right(), south, 0), zoomLevel); rect.setRight( key.x() ); rect.setBottom( key.y() ); TileCoordsPyramid pyramid(0, zoomLevel ); pyramid.setBottomLevelCoords( rect ); for ( int level = pyramid.topLevel(); level <= pyramid.bottomLevel(); ++level ) { QRect const coords = pyramid.coords( level ); int x1, y1, x2, y2; coords.getCoords( &x1, &y1, &x2, &y2 ); for ( int x = x1; x <= x2; ++x ) { for ( int y = y1; y <= y2; ++y ) { TileId const tileId( 0, level, x, y ); tileIdSet.insert(tileId); } } } } return tileIdSet; } QVector PlacemarkLayout::generateLayout( const ViewportParams *viewport ) { m_runtimeTrace.clear(); if ( m_placemarkModel->rowCount() <= 0 ) return QVector(); if ( m_styleResetRequested ) { styleReset(); } if ( m_maxLabelHeight == 0 ) { return QVector(); } const int secnumber = viewport->height() / m_maxLabelHeight + 1; m_rowsection.clear(); m_rowsection.resize(secnumber); m_paintOrder.clear(); m_labelArea = 0; // First handle the selected placemarks as they have the highest priority. const QModelIndexList selectedIndexes = m_selectionModel->selection().indexes(); for ( int i = 0; i < selectedIndexes.count(); ++i ) { const QModelIndex index = selectedIndexes.at( i ); const GeoDataPlacemark *placemark = dynamic_cast(qvariant_cast(index.data( MarblePlacemarkModel::ObjectPointerRole ) )); Q_ASSERT(placemark); const GeoDataCoordinates coordinates = placemarkIconCoordinates( placemark ); if ( !coordinates.isValid() ) { continue; } qreal x = 0; qreal y = 0; if ( !viewport->viewLatLonAltBox().contains( coordinates ) || ! viewport->screenCoordinates( coordinates, x, y )) { delete m_visiblePlacemarks.take( placemark ); continue; } if( layoutPlacemark( placemark, x, y, true) ) { // Make sure not to draw more placemarks on the screen than // specified by placemarksOnScreenLimit(). if ( placemarksOnScreenLimit( viewport->size() ) ) break; } } // Now handle all other placemarks... const QItemSelection selection = m_selectionModel->selection(); QList placemarkList; foreach ( const TileId &tileId, visibleTiles( viewport ) ) { placemarkList += m_placemarkCache.value( tileId ); } qSort(placemarkList.begin(), placemarkList.end(), GeoDataPlacemark::placemarkLayoutOrderCompare); auto const viewLatLonAltBox = viewport->viewLatLonAltBox(); foreach ( const GeoDataPlacemark *placemark, placemarkList ) { const GeoDataCoordinates coordinates = placemarkIconCoordinates( placemark ); if ( !coordinates.isValid() ) { continue; } int zoomLevel = placemark->zoomLevel(); if ( zoomLevel > 18 ) { break; } qreal x = 0; qreal y = 0; if ( !viewLatLonAltBox.contains( coordinates ) || ! viewport->screenCoordinates( coordinates, x, y )) { delete m_visiblePlacemarks.take( placemark ); continue; } if ( !placemark->isGloballyVisible() ) { continue; } const GeoDataFeature::GeoDataVisualCategory visualCategory = placemark->visualCategory(); // Skip city marks if we're not showing cities. if ( !m_showCities && visualCategory >= GeoDataFeature::SmallCity && visualCategory <= GeoDataFeature::Nation ) continue; // Skip terrain marks if we're not showing terrain. if ( !m_showTerrain && visualCategory >= GeoDataFeature::Mountain && visualCategory <= GeoDataFeature::OtherTerrain ) continue; // Skip other places if we're not showing other places. if ( !m_showOtherPlaces && visualCategory >= GeoDataFeature::GeographicPole && visualCategory <= GeoDataFeature::Observatory ) continue; // Skip landing sites if we're not showing landing sites. if ( !m_showLandingSites && visualCategory >= GeoDataFeature::MannedLandingSite && visualCategory <= GeoDataFeature::UnmannedHardLandingSite ) continue; // Skip craters if we're not showing craters. if ( !m_showCraters && visualCategory == GeoDataFeature::Crater ) continue; // Skip maria if we're not showing maria. if ( !m_showMaria && visualCategory == GeoDataFeature::Mare ) continue; if ( !m_showPlaces && visualCategory >= GeoDataFeature::GeographicPole && visualCategory <= GeoDataFeature::Observatory ) continue; // We handled selected placemarks already, so we skip them here... // Assuming that only a small amount of places is selected // we check for the selected state after all other filters bool isSelected = false; foreach ( const QModelIndex &index, selection.indexes() ) { const GeoDataPlacemark *mark = dynamic_cast(qvariant_cast(index.data( MarblePlacemarkModel::ObjectPointerRole ) )); if (mark == placemark ) { isSelected = true; break; } } if ( isSelected ) continue; if( layoutPlacemark( placemark, x, y, isSelected ) ) { // Make sure not to draw more placemarks on the screen than // specified by placemarksOnScreenLimit(). if ( placemarksOnScreenLimit( viewport->size() ) ) break; } } m_runtimeTrace = QString("Placemarks: %1 Drawn: %2").arg( placemarkList.count() ).arg( m_paintOrder.size() ); return m_paintOrder; } QString PlacemarkLayout::runtimeTrace() const { return m_runtimeTrace; } bool PlacemarkLayout::layoutPlacemark( const GeoDataPlacemark *placemark, qreal x, qreal y, bool selected ) { // Find the corresponding visible placemark VisiblePlacemark *mark = m_visiblePlacemarks.value( placemark ); if ( !mark ) { // If there is no visible placemark yet for this index, // create a new one... StyleParameters parameters; // @todo: Set / adjust to tile level parameters.feature = placemark; mark = new VisiblePlacemark(placemark, m_styleBuilder->createStyle(parameters)); m_visiblePlacemarks.insert( placemark, mark ); connect( mark, SIGNAL(updateNeeded()), this, SIGNAL(repaintNeeded()) ); } GeoDataStyle::ConstPtr style = mark->style(); // Choose Section // Find out whether the area around the placemark is covered already. // If there's not enough space free don't add a VisiblePlacemark here. QRectF labelRect; const QString labelText = placemark->displayName(); if (!labelText.isEmpty()) { labelRect = roomForLabel(style, x, y, labelText); if ( labelRect.isNull() ) { return false; } } // Finally save the label position on the map. QPointF hotSpot = mark->hotSpot(); if( mark->selected() != selected ) { mark->setSelected( selected ); } mark->setSymbolPosition(QPoint(qRound(x - hotSpot.x()), qRound(y - hotSpot.y()))); mark->setLabelRect( labelRect ); if ( !labelRect.isEmpty() ) { // Add the current placemark to the matching row and its // direct neighbors. int idx = y / m_maxLabelHeight; if ( idx - 1 >= 0 ) m_rowsection[ idx - 1 ].append( mark ); m_rowsection[ idx ].append( mark ); if ( idx + 1 < m_rowsection.size() ) m_rowsection[ idx + 1 ].append( mark ); } m_paintOrder.append( mark ); m_labelArea += labelRect.width() * labelRect.height(); m_maxLabelHeight = qMax(m_maxLabelHeight, qCeil(labelRect.height())); return true; } GeoDataCoordinates PlacemarkLayout::placemarkIconCoordinates( const GeoDataPlacemark *placemark ) const { bool ok; GeoDataCoordinates coordinates = placemark->coordinate( m_clock->dateTime(), &ok ); if ( !ok && m_acceptedVisualCategories.contains(placemark->visualCategory()) ) { ok = true; } if ( ok ) { return coordinates; } return GeoDataCoordinates(); } QRectF PlacemarkLayout::roomForLabel( const GeoDataStyle::ConstPtr &style, const qreal x, const qreal y, const QString &labelText ) const { QFont labelFont = style->labelStyle().scaledFont(); int textHeight = QFontMetrics( labelFont ).height(); int textWidth; if ( style->labelStyle().glow() ) { labelFont.setWeight( 75 ); // Needed to calculate the correct pixmap size; textWidth = ( QFontMetrics( labelFont ).width( labelText ) + qRound( 2 * s_labelOutlineWidth ) ); } else { textWidth = ( QFontMetrics( labelFont ).width( labelText ) ); } const QVector currentsec = m_rowsection.at( y / m_maxLabelHeight ); if ( style->labelStyle().alignment() == GeoDataLabelStyle::Corner ) { const int symbolWidth = style->iconStyle().scaledIcon().size().width(); // Check the four possible positions by going through all of them for( int i=0; i<4; ++i ) { const qreal xPos = ( i/2 == 0 ) ? x + symbolWidth / 2 + 1 : x - symbolWidth / 2 - 1 - textWidth; const qreal yPos = ( i%2 == 0 ) ? y : y - textHeight; const QRectF labelRect = QRectF( xPos, yPos, textWidth, textHeight ); if (hasRoomFor(currentsec, labelRect)) { // claim the place immediately if it hasn't been used yet return labelRect; } } } else if ( style->labelStyle().alignment() == GeoDataLabelStyle::Center ) { int const offsetY = style->iconStyle().scaledIcon().height() / 1.5; QRectF labelRect( x - textWidth / 2, offsetY + y - textHeight / 2, textWidth, textHeight ); if (hasRoomFor(currentsec, labelRect)) { // claim the place immediately if it hasn't been used yet return labelRect; } } else if (style->labelStyle().alignment() == GeoDataLabelStyle::Right) { const int symbolWidth = style->iconStyle().icon().width(); const qreal startY = y - textHeight/2; const qreal xPos = x + symbolWidth / 2 + 1; // Check up to seven vertical positions (center, +3, -3 from center) for(int i=0; i<7; ++i) { const qreal increase = (i/2) * (textHeight + 1); //intentional integer arithmetics const qreal direction = (i%2 == 0 ? 1 : -1); const qreal yPos = startY + increase*direction; const QRectF labelRect = QRectF(xPos, yPos, textWidth, textHeight); if (hasRoomFor(currentsec, labelRect)) { return labelRect; } } } return QRectF(); // At this point there is no space left // for the rectangle anymore. } bool PlacemarkLayout::placemarksOnScreenLimit( const QSize &screenSize ) const { int ratio = ( m_labelArea * 100 ) / ( screenSize.width() * screenSize.height() ); return ratio >= 40; } } #include "moc_PlacemarkLayout.cpp" diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp index 1b455083b..12ba46f42 100644 --- a/src/lib/marble/StyleBuilder.cpp +++ b/src/lib/marble/StyleBuilder.cpp @@ -1,1532 +1,1534 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2007 Murad Tagirov // Copyright 2009 Patrick Spendrin // Copyright 2016 Dennis Nienhüser // #include "StyleBuilder.h" #include "MarbleDirs.h" #include "OsmPlacemarkData.h" #include "GeoDataTypes.h" #include "GeoDataPlacemark.h" #include "OsmPresetLibrary.h" #include #include #include #include #include #include namespace Marble { class StyleBuilder::Private { public: Private(); static GeoDataStyle::Ptr createStyle( qreal width, qreal realWidth, const QColor& color, const QColor& outlineColor, bool fill, bool outline, Qt::BrushStyle brushStyle, Qt::PenStyle penStyle, Qt::PenCapStyle capStyle, bool lineBackground, const QVector< qreal >& dashPattern = QVector< qreal >(), const QFont& font = QFont(QLatin1String("Arial")), const QColor& fontColor = Qt::black, const QString& texturePath = QString()); static GeoDataStyle::Ptr createPOIStyle( const QFont &font, const QString &bitmap, const QColor &textColor = Qt::black, const QColor &color = QColor( 0xBE, 0xAD, 0xAD ), const QColor &outline = QColor( 0xBE, 0xAD, 0xAD ).darker() ); static GeoDataStyle::Ptr createOsmPOIStyle( const QFont &font, const QString &bitmap, const QColor &textColor = Qt::black, const QColor &color = QColor( 0xBE, 0xAD, 0xAD ), const QColor &outline = QColor( 0xBE, 0xAD, 0xAD ).darker() ); static GeoDataStyle::Ptr createHighwayStyle( const QString &bitmap, const QColor& color, const QColor& outlineColor, const QFont& font = QFont(QLatin1String("Arial")), const QColor& fontColor = Qt::black, qreal width = 1, qreal realWidth = 0.0, Qt::PenStyle penStyle = Qt::SolidLine, Qt::PenCapStyle capStyle = Qt::RoundCap, bool lineBackground = false); static GeoDataStyle::Ptr createWayStyle( const QColor& color, const QColor& outlineColor, bool fill = true, bool outline = true, Qt::BrushStyle brushStyle = Qt::SolidPattern, const QString& texturePath = QString()); void initializeDefaultStyles(); static QString createPaintLayerItem(const QString &itemType, GeoDataFeature::GeoDataVisualCategory visualCategory, const QString &subType = QString()); int m_defaultMinZoomLevels[GeoDataFeature::LastIndex]; int m_maximumZoomLevel; QColor m_defaultLabelColor; QFont m_defaultFont; GeoDataStyle::Ptr m_defaultStyle[GeoDataFeature::LastIndex]; bool m_defaultStyleInitialized; }; StyleBuilder::Private::Private() : m_maximumZoomLevel(15), m_defaultLabelColor(Qt::black), m_defaultFont(QStringLiteral("Sans Serif")), m_defaultStyle(), m_defaultStyleInitialized(false) { for ( int i = 0; i < GeoDataFeature::LastIndex; i++ ) m_defaultMinZoomLevels[i] = m_maximumZoomLevel; m_defaultMinZoomLevels[GeoDataFeature::Default] = 1; m_defaultMinZoomLevels[GeoDataFeature::NaturalReef] = 3; m_defaultMinZoomLevels[GeoDataFeature::NaturalWater] = 3; m_defaultMinZoomLevels[GeoDataFeature::NaturalWood] = 8; m_defaultMinZoomLevels[GeoDataFeature::NaturalBeach] = 10; m_defaultMinZoomLevels[GeoDataFeature::NaturalWetland] = 10; m_defaultMinZoomLevels[GeoDataFeature::NaturalGlacier] = 3; m_defaultMinZoomLevels[GeoDataFeature::NaturalIceShelf] = 3; m_defaultMinZoomLevels[GeoDataFeature::NaturalScrub] = 10; m_defaultMinZoomLevels[GeoDataFeature::NaturalCliff] = 15; m_defaultMinZoomLevels[GeoDataFeature::NaturalPeak] = 11; m_defaultMinZoomLevels[GeoDataFeature::BarrierCityWall] = 15; m_defaultMinZoomLevels[GeoDataFeature::Building] = 15; m_defaultMinZoomLevels[GeoDataFeature::ManmadeBridge] = 15; // OpenStreetMap highways m_defaultMinZoomLevels[GeoDataFeature::HighwaySteps] = 15; m_defaultMinZoomLevels[GeoDataFeature::HighwayUnknown] = 13; m_defaultMinZoomLevels[GeoDataFeature::HighwayPath] = 13; m_defaultMinZoomLevels[GeoDataFeature::HighwayTrack] = 13; m_defaultMinZoomLevels[GeoDataFeature::HighwayPedestrian] = 13; m_defaultMinZoomLevels[GeoDataFeature::HighwayFootway] = 13; m_defaultMinZoomLevels[GeoDataFeature::HighwayCycleway] = 13; m_defaultMinZoomLevels[GeoDataFeature::HighwayService] = 13; m_defaultMinZoomLevels[GeoDataFeature::HighwayRoad] = 13; m_defaultMinZoomLevels[GeoDataFeature::HighwayTertiaryLink] = 10; m_defaultMinZoomLevels[GeoDataFeature::HighwayTertiary] = 10; m_defaultMinZoomLevels[GeoDataFeature::HighwaySecondaryLink]= 10; m_defaultMinZoomLevels[GeoDataFeature::HighwaySecondary] = 9; m_defaultMinZoomLevels[GeoDataFeature::HighwayPrimaryLink] = 10; m_defaultMinZoomLevels[GeoDataFeature::HighwayPrimary] = 8; m_defaultMinZoomLevels[GeoDataFeature::HighwayTrunkLink] = 10; m_defaultMinZoomLevels[GeoDataFeature::HighwayTrunk] = 7; m_defaultMinZoomLevels[GeoDataFeature::HighwayMotorwayLink] = 10; m_defaultMinZoomLevels[GeoDataFeature::HighwayMotorway] = 6; m_defaultMinZoomLevels[GeoDataFeature::TransportAirportRunway] = 15; + m_defaultMinZoomLevels[GeoDataFeature::TransportAirportTaxiway] = 15; #if 0 // not needed as long as default min zoom level is 15 for(int i = GeoDataFeature::AccomodationCamping; i <= GeoDataFeature::ReligionSikh; i++) s_defaultMinZoomLevels[i] = 15; #endif m_defaultMinZoomLevels[GeoDataFeature::AmenityGraveyard] = 14; m_defaultMinZoomLevels[GeoDataFeature::AmenityFountain] = 17; m_defaultMinZoomLevels[GeoDataFeature::MilitaryDangerArea] = 11; m_defaultMinZoomLevels[GeoDataFeature::LeisureMarina] = 13; m_defaultMinZoomLevels[GeoDataFeature::LeisurePark] = 11; m_defaultMinZoomLevels[GeoDataFeature::LeisurePlayground] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseAllotments] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseBasin] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseCemetery] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseCommercial] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseConstruction] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseFarmland] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseFarmyard] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseGarages] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseGrass] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseIndustrial] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseLandfill] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseMeadow] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseMilitary] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseQuarry] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseRailway] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseReservoir] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseResidential] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseRetail] = 11; m_defaultMinZoomLevels[GeoDataFeature::LanduseOrchard] = 14; m_defaultMinZoomLevels[GeoDataFeature::LanduseVineyard] = 14; m_defaultMinZoomLevels[GeoDataFeature::RailwayRail] = 6; m_defaultMinZoomLevels[GeoDataFeature::RailwayNarrowGauge] = 6; m_defaultMinZoomLevels[GeoDataFeature::RailwayTram] = 14; m_defaultMinZoomLevels[GeoDataFeature::RailwayLightRail] = 12; m_defaultMinZoomLevels[GeoDataFeature::RailwayAbandoned] = 10; m_defaultMinZoomLevels[GeoDataFeature::RailwaySubway] = 13; m_defaultMinZoomLevels[GeoDataFeature::RailwayPreserved] = 13; m_defaultMinZoomLevels[GeoDataFeature::RailwayMiniature] = 13; m_defaultMinZoomLevels[GeoDataFeature::RailwayConstruction] = 10; m_defaultMinZoomLevels[GeoDataFeature::RailwayMonorail] = 12; m_defaultMinZoomLevels[GeoDataFeature::RailwayFunicular] = 13; m_defaultMinZoomLevels[GeoDataFeature::TransportPlatform] = 16; m_defaultMinZoomLevels[GeoDataFeature::Satellite] = 0; m_defaultMinZoomLevels[GeoDataFeature::Landmass] = 0; m_defaultMinZoomLevels[GeoDataFeature::UrbanArea] = 3; m_defaultMinZoomLevels[GeoDataFeature::InternationalDateLine] = 1; m_defaultMinZoomLevels[GeoDataFeature::Bathymetry] = 1; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel1] = 0; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel2] = 1; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel3] = 1; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel4] = 2; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel5] = 4; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel6] = 5; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel7] = 5; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel8] = 7; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel9] = 7; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel10] = 8; m_defaultMinZoomLevels[GeoDataFeature::AdminLevel11] = 8; m_defaultMinZoomLevels[GeoDataFeature::BoundaryMaritime] = 1; for (int i = 0; i < GeoDataFeature::LastIndex; ++i) { m_maximumZoomLevel = qMax(m_maximumZoomLevel, m_defaultMinZoomLevels[i]); } } GeoDataStyle::Ptr StyleBuilder::Private::createPOIStyle( const QFont &font, const QString &path, const QColor &textColor, const QColor &color, const QColor &outline) { GeoDataStyle::Ptr style = createStyle(1, 0, color, outline, true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false); style->setIconStyle( GeoDataIconStyle( path) ); auto const screen = QApplication::screens().first(); double const physicalSize = 6.0; // mm int const pixelSize = qRound(physicalSize * screen->physicalDotsPerInch() / (IN2M * M2MM)); style->iconStyle().setSize(QSize(pixelSize, pixelSize)); style->setLabelStyle( GeoDataLabelStyle( font, textColor ) ); style->labelStyle().setAlignment(GeoDataLabelStyle::Center); style->polyStyle().setFill(false); style->polyStyle().setOutline(false); return style; } GeoDataStyle::Ptr StyleBuilder::Private::createOsmPOIStyle( const QFont &font, const QString &imagePath, const QColor &textColor, const QColor &color, const QColor &outline) { QString const path = MarbleDirs::path( "svg/osmcarto/svg/" + imagePath + ".svg" ); return createPOIStyle(font, path, textColor, color, outline); } GeoDataStyle::Ptr StyleBuilder::Private::createHighwayStyle( const QString &imagePath, const QColor& color, const QColor& outlineColor, const QFont& font, const QColor& fontColor, qreal width, qreal realWidth, Qt::PenStyle penStyle, Qt::PenCapStyle capStyle, bool lineBackground) { GeoDataStyle::Ptr style = createStyle( width, realWidth, color, outlineColor, true, true, Qt::SolidPattern, penStyle, capStyle, lineBackground, QVector< qreal >(), font, fontColor ); if( !imagePath.isEmpty() ) { style->setIconStyle( GeoDataIconStyle( MarbleDirs::path( "svg/osmcarto/svg/" + imagePath + ".svg" ) ) ); } return style; } GeoDataStyle::Ptr StyleBuilder::Private::createWayStyle( const QColor& color, const QColor& outlineColor, bool fill, bool outline, Qt::BrushStyle brushStyle, const QString& texturePath) { return createStyle( 1, 0, color, outlineColor, fill, outline, brushStyle, Qt::SolidLine, Qt::RoundCap, false, QVector< qreal >(), QFont("Arial"), Qt::black, texturePath ); } GeoDataStyle::Ptr StyleBuilder::Private::createStyle( qreal width, qreal realWidth, const QColor& color, const QColor& outlineColor, bool fill, bool outline, Qt::BrushStyle brushStyle, Qt::PenStyle penStyle, Qt::PenCapStyle capStyle, bool lineBackground, const QVector< qreal >& dashPattern, const QFont& font, const QColor& fontColor, const QString& texturePath) { GeoDataStyle *style = new GeoDataStyle; GeoDataLineStyle lineStyle( outlineColor ); lineStyle.setCapStyle( capStyle ); lineStyle.setPenStyle( penStyle ); lineStyle.setWidth( width ); lineStyle.setPhysicalWidth( realWidth ); lineStyle.setBackground( lineBackground ); lineStyle.setDashPattern( dashPattern ); GeoDataPolyStyle polyStyle( color ); polyStyle.setOutline( outline ); polyStyle.setFill( fill ); polyStyle.setBrushStyle( brushStyle ); polyStyle.setTexturePath( texturePath ); GeoDataLabelStyle labelStyle(font, fontColor); style->setLineStyle( lineStyle ); style->setPolyStyle( polyStyle ); style->setLabelStyle( labelStyle ); return GeoDataStyle::Ptr(style); } void StyleBuilder::Private::initializeDefaultStyles() { // We need to do this similar to the way KCmdLineOptions works in // the future: Having a PlacemarkStyleProperty properties[] would // help here greatly. if (m_defaultStyleInitialized) { return; } m_defaultStyleInitialized = true; QString defaultFamily = m_defaultFont.family(); #ifdef Q_OS_MACX int defaultSize = 10; #else int defaultSize = 8; #endif QColor const defaultLabelColor = m_defaultLabelColor; m_defaultStyle[GeoDataFeature::None] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Default] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/default_location.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Unknown] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::SmallCity] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_4_white.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::SmallCountyCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_4_yellow.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::SmallStateCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_4_orange.png" ), QFont( defaultFamily, defaultSize, 50, true ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::SmallNationCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_4_red.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::MediumCity] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_3_white.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::MediumCountyCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_3_yellow.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::MediumStateCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_3_orange.png" ), QFont( defaultFamily, defaultSize, 50, true ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::MediumNationCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_3_red.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::BigCity] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_2_white.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::BigCountyCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_2_yellow.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::BigStateCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_2_orange.png" ), QFont( defaultFamily, defaultSize, 50, true ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::BigNationCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_2_red.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::LargeCity] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_1_white.png" ), QFont( defaultFamily, defaultSize, 75, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::LargeCountyCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_1_yellow.png" ), QFont( defaultFamily, defaultSize, 75, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::LargeStateCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_1_orange.png" ), QFont( defaultFamily, defaultSize, 75, true ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::LargeNationCapital] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/city_1_red.png" ), QFont( defaultFamily, defaultSize, 75, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Nation] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 1.2 ), 75, false ), QColor( "#404040" ) )); // Align area labels centered m_defaultStyle[GeoDataFeature::Nation]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::PlaceCity] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 2.0 ), 75, false ), QColor( "#202020" ) )); m_defaultStyle[GeoDataFeature::PlaceCity]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::PlaceSuburb] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 2.0 ), 75, false ), QColor( "#707070" ) )); m_defaultStyle[GeoDataFeature::PlaceSuburb]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::PlaceHamlet] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 2.0 ), 75, false ), QColor( "#707070" ) )); m_defaultStyle[GeoDataFeature::PlaceHamlet]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::PlaceLocality] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 2.0 ), 75, false ), QColor( "#707070" ) )); m_defaultStyle[GeoDataFeature::PlaceLocality]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::PlaceTown] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 2.0 ), 75, false ), QColor( "#404040" ) )); m_defaultStyle[GeoDataFeature::PlaceTown]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::PlaceVillage] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 2.0 ), 75, false ), QColor( "#505050" ) )); m_defaultStyle[GeoDataFeature::PlaceVillage]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); for (int i=GeoDataFeature::PlaceCity; i<=GeoDataFeature::PlaceVillage; ++i) { m_defaultStyle[GeoDataFeature::GeoDataVisualCategory(i)]->polyStyle().setFill(false); m_defaultStyle[GeoDataFeature::GeoDataVisualCategory(i)]->polyStyle().setOutline(false); } m_defaultStyle[GeoDataFeature::Mountain] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/mountain_1.png" ), QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Volcano] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/volcano_1.png" ), QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Mons] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/mountain_1.png" ), QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Valley] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/valley.png" ), QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Continent] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, false ), QColor( "#bf0303" ) )); // Align area labels centered m_defaultStyle[GeoDataFeature::Continent]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::Ocean] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, true ), QColor( "#2c72c7" ) )); // Align area labels centered m_defaultStyle[GeoDataFeature::Ocean]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::OtherTerrain] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/other.png" ), QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Crater] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/crater.png" ), QFont( defaultFamily, (int)(defaultSize * 0.9 ), 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Mare] = GeoDataStyle::Ptr(new GeoDataStyle( QString(), QFont( defaultFamily, (int)(defaultSize * 1.7 ), 50, false ), QColor( "#bf0303" ) )); // Align area labels centered m_defaultStyle[GeoDataFeature::Mare]->labelStyle().setAlignment( GeoDataLabelStyle::Center ); m_defaultStyle[GeoDataFeature::GeographicPole] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/pole_1.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::MagneticPole] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/pole_2.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::ShipWreck] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/shipwreck.png" ), QFont( defaultFamily, (int)(defaultSize * 0.8 ), 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::AirPort] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/airport.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Observatory] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/observatory.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::OsmSite] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/osm.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Coordinate] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/coordinate.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::MannedLandingSite] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/manned_landing.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::RoboticRover] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/robotic_rover.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::UnmannedSoftLandingSite] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/unmanned_soft_landing.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::UnmannedHardLandingSite] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/unmanned_hard_landing.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Folder] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/folder.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); m_defaultStyle[GeoDataFeature::Bookmark] = StyleBuilder::Private::createPOIStyle(QFont( defaultFamily, defaultSize, 50, false ), MarbleDirs::path("svg/bookmark.svg"), defaultLabelColor ); m_defaultStyle[GeoDataFeature::Bookmark]->iconStyle().setScale(0.75); QColor const shopColor("#ac39ac"); QColor const transportationColor("#0066ff"); QColor const amenityColor("#734a08"); QColor const healthColor("#da0092"); QColor const airTransportColor("#8461C4"); QColor const educationalAreasAndHospital("#f0f0d8"); QColor const buildingColor("#beadad"); QColor const waterColor("#b5d0d0"); // Allows to visualize multiple repaints of buildings // QColor const buildingColor(0, 255, 0, 64); QFont const osmFont( defaultFamily, 10, 50, false ); m_defaultStyle[GeoDataFeature::AccomodationCamping] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/camping.16", transportationColor ); m_defaultStyle[GeoDataFeature::AccomodationHostel] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/hostel.16", transportationColor ); m_defaultStyle[GeoDataFeature::AccomodationHotel] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/hotel.16", transportationColor ); m_defaultStyle[GeoDataFeature::AccomodationMotel] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/motel.16", transportationColor ); m_defaultStyle[GeoDataFeature::AccomodationYouthHostel] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/hostel.16", transportationColor ); m_defaultStyle[GeoDataFeature::AccomodationGuestHouse] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/guest_house.16", transportationColor ); m_defaultStyle[GeoDataFeature::AmenityLibrary] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/library.20", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityKindergarten] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), amenityColor, educationalAreasAndHospital, amenityColor ); m_defaultStyle[GeoDataFeature::EducationCollege] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), amenityColor, educationalAreasAndHospital, amenityColor ); m_defaultStyle[GeoDataFeature::EducationSchool] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), amenityColor, educationalAreasAndHospital, amenityColor ); m_defaultStyle[GeoDataFeature::EducationUniversity] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), amenityColor, educationalAreasAndHospital, amenityColor ); m_defaultStyle[GeoDataFeature::FoodBar] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/bar.16", amenityColor ); m_defaultStyle[GeoDataFeature::FoodBiergarten] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/biergarten.16", amenityColor ); m_defaultStyle[GeoDataFeature::FoodCafe] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/cafe.16", amenityColor ); m_defaultStyle[GeoDataFeature::FoodFastFood] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/fast_food.16", amenityColor ); m_defaultStyle[GeoDataFeature::FoodPub] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/pub.16", amenityColor ); m_defaultStyle[GeoDataFeature::FoodRestaurant] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/restaurant.16", amenityColor ); m_defaultStyle[GeoDataFeature::HealthDentist] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "health/dentist.16", healthColor ); m_defaultStyle[GeoDataFeature::HealthDoctors] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "health/doctors.16", healthColor ); m_defaultStyle[GeoDataFeature::HealthHospital] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "health/hospital.16", healthColor, educationalAreasAndHospital, amenityColor ); m_defaultStyle[GeoDataFeature::HealthPharmacy] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "health/pharmacy.16", healthColor ); m_defaultStyle[GeoDataFeature::HealthVeterinary] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "health/veterinary-14", healthColor ); m_defaultStyle[GeoDataFeature::MoneyAtm] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/atm.16", amenityColor ); m_defaultStyle[GeoDataFeature::MoneyBank] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/bank.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityArchaeologicalSite] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/archaeological_site.16", amenityColor, Qt::transparent ); m_defaultStyle[GeoDataFeature::AmenityEmbassy] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/embassy.16", transportationColor ); m_defaultStyle[GeoDataFeature::AmenityEmergencyPhone] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/emergency_phone.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityWaterPark] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/water_park.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityCommunityCentre] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/community_centre-14", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityFountain] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/fountain-14", QColor("#7989de"), waterColor, waterColor.darker(150) ); m_defaultStyle[GeoDataFeature::AmenityNightClub] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/nightclub.18", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityBench] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/bench.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityCourtHouse] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/courthouse-16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityFireStation] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/firestation.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityHuntingStand] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "manmade/hunting-stand.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityPolice] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/police.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityPostBox] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/post_box-12", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityPostOffice] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/post_office-14", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityPrison] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/prison.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityRecycling] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/recycling.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityShelter] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/shelter-14", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityTelephone] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/telephone.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityToilets] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/toilets.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityTownHall] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/town_hall.16", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityWasteBasket] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/waste_basket.10", amenityColor ); m_defaultStyle[GeoDataFeature::AmenityDrinkingWater] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/drinking_water.16", amenityColor ); m_defaultStyle[GeoDataFeature::NaturalPeak] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/peak", amenityColor ); m_defaultStyle[GeoDataFeature::NaturalPeak]->iconStyle().setScale(0.33); m_defaultStyle[GeoDataFeature::NaturalTree] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/tree-29", amenityColor ); // tree-16 provides the official icon m_defaultStyle[GeoDataFeature::ShopBeverages] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/beverages-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopHifi] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/hifi-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopSupermarket] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_supermarket", shopColor ); m_defaultStyle[GeoDataFeature::ShopAlcohol] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_alcohol.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopBakery] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_bakery.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopButcher] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/butcher-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopConfectionery] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/confectionery.14", shopColor ); m_defaultStyle[GeoDataFeature::ShopConvenience] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_convenience", shopColor ); m_defaultStyle[GeoDataFeature::ShopGreengrocer] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/greengrocer-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopSeafood] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/seafood-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopDepartmentStore] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/department_store-16", shopColor ); m_defaultStyle[GeoDataFeature::ShopKiosk] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/kiosk-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopBag] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/bag-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopClothes] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_clothes.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopFashion] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_clothes.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopJewelry] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_jewelry.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopShoes] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_shoes.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopVarietyStore] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/variety_store-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopBeauty] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/beauty-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopChemist] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/chemist-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopCosmetics] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/perfumery-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopHairdresser] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_hairdresser.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopOptician] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_optician.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopPerfumery] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/perfumery-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopDoitYourself] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_diy.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopFlorist] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/florist.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopHardware] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_diy.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopFurniture] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_furniture.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopElectronics] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_electronics.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopMobilePhone] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_mobile_phone.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopBicycle] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_bicycle.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopCar] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_car", shopColor ); m_defaultStyle[GeoDataFeature::ShopCarRepair] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shopping_car_repair.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopCarParts] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/car_parts-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopMotorcycle] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/motorcycle-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopOutdoor] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/outdoor-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopMusicalInstrument] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/musical_instrument-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopPhoto] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/photo-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopBook] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_books.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopGift] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_gift.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopStationery] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/stationery-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopLaundry] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/laundry-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopPet] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop_pet.16", shopColor ); m_defaultStyle[GeoDataFeature::ShopToys] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/toys-14", shopColor ); m_defaultStyle[GeoDataFeature::ShopTravelAgency] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/travel_agency-14", shopColor ); m_defaultStyle[GeoDataFeature::Shop] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "shop/shop-14", shopColor ); m_defaultStyle[GeoDataFeature::ManmadeBridge] = StyleBuilder::Private::createWayStyle( QColor("#b8b8b8"), QColor("transparent"), true, true ); m_defaultStyle[GeoDataFeature::ManmadeLighthouse] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/lighthouse.16", transportationColor, "#f2efe9", QColor( "#f2efe9" ).darker() ); m_defaultStyle[GeoDataFeature::ManmadePier] = StyleBuilder::Private::createStyle(0.0, 3.0, "#f2efe9", "#f2efe9", true, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::ManmadeWaterTower] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/water_tower.16", amenityColor ); m_defaultStyle[GeoDataFeature::ManmadeWindMill] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/windmill.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristAttraction] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/tourist_memorial.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristCastle] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/cinema.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristCinema] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/cinema.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristInformation] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/information.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristMonument] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/monument.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristMuseum] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/museum.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristRuin] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), amenityColor ); m_defaultStyle[GeoDataFeature::TouristTheatre] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/theatre.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristThemePark] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), amenityColor ); m_defaultStyle[GeoDataFeature::TouristViewPoint] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/viewpoint.16", amenityColor ); m_defaultStyle[GeoDataFeature::TouristZoo] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), amenityColor, Qt::transparent ); m_defaultStyle[GeoDataFeature::TouristAlpineHut] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/alpinehut.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportAerodrome] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "airtransport/aerodrome", airTransportColor ); m_defaultStyle[GeoDataFeature::TransportHelipad] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "airtransport/helipad", airTransportColor ); m_defaultStyle[GeoDataFeature::TransportAirportTerminal] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), airTransportColor ); m_defaultStyle[GeoDataFeature::TransportAirportGate] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), airTransportColor ); m_defaultStyle[GeoDataFeature::TransportBusStation] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/bus_station.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportBusStop] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/bus_stop.12", transportationColor ); m_defaultStyle[GeoDataFeature::TransportCarShare] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/car_share.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportFuel] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/fuel.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportParking] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/parking", transportationColor, "#F6EEB6", QColor( "#F6EEB6" ).darker() ); m_defaultStyle[GeoDataFeature::TransportParkingSpace] = StyleBuilder::Private::createWayStyle( "#F6EEB6", QColor( "#F6EEB6" ).darker(), true, true ); m_defaultStyle[GeoDataFeature::TransportPlatform] = StyleBuilder::Private::createWayStyle( "#bbbbbb", Qt::transparent, true, false ); m_defaultStyle[GeoDataFeature::TransportTrainStation] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/railway_station", transportationColor ); m_defaultStyle[GeoDataFeature::TransportTramStop] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), transportationColor ); m_defaultStyle[GeoDataFeature::TransportRentalBicycle] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/rental_bicycle.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportRentalCar] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/rental_car.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportTaxiRank] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/taxi.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportBicycleParking] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/bicycle_parking.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportMotorcycleParking] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/motorcycle_parking.16", transportationColor ); m_defaultStyle[GeoDataFeature::TransportSubwayEntrance] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "transportation/subway_entrance", transportationColor ); m_defaultStyle[GeoDataFeature::ReligionPlaceOfWorship] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString() /* "black/place_of_worship.16" */ ); m_defaultStyle[GeoDataFeature::ReligionBahai] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString() ); m_defaultStyle[GeoDataFeature::ReligionBuddhist] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "black/buddhist.16" ); m_defaultStyle[GeoDataFeature::ReligionChristian] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "black/christian.16" ); m_defaultStyle[GeoDataFeature::ReligionMuslim] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "black/muslim.16" ); m_defaultStyle[GeoDataFeature::ReligionHindu] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "black/hinduist.16" ); m_defaultStyle[GeoDataFeature::ReligionJain] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString() ); m_defaultStyle[GeoDataFeature::ReligionJewish] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "black/jewish.16" ); m_defaultStyle[GeoDataFeature::ReligionShinto] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "black/shintoist.16" ); m_defaultStyle[GeoDataFeature::ReligionSikh] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "black/sikhist.16" ); m_defaultStyle[GeoDataFeature::HighwayTrafficSignals] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/traffic_light" ); m_defaultStyle[GeoDataFeature::PowerTower] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/power_tower", QColor( "#888888" ) ); m_defaultStyle[GeoDataFeature::PowerTower]->iconStyle().setScale(0.6); m_defaultStyle[GeoDataFeature::BarrierCityWall] = StyleBuilder::Private::createStyle( 6.0, 3.0, "#787878", "transparent", true, false, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false, QVector< qreal >(), QFont(), "transparent" ); m_defaultStyle[GeoDataFeature::BarrierGate] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/gate" ); m_defaultStyle[GeoDataFeature::BarrierLiftGate] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "individual/liftgate" ); m_defaultStyle[GeoDataFeature::BarrierWall] = StyleBuilder::Private::createStyle( 2.0, 0.0, "#787878", "transparent", true, false, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false, QVector< qreal >(), QFont(), "transparent" ); m_defaultStyle[GeoDataFeature::HighwaySteps] = StyleBuilder::Private::createStyle(0.0, 2.0, "#fa8072", QColor(Qt::white), true, true, Qt::SolidPattern, Qt::CustomDashLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::HighwayUnknown] = StyleBuilder::Private::createHighwayStyle( "highway_unknown", "#ddd", "#bbb", QFont(QStringLiteral("Arial")), "000000", 0.0, 1.0); m_defaultStyle[GeoDataFeature::HighwayPath] = StyleBuilder::Private::createHighwayStyle( "highway_path", "#dddde8", "#999", QFont(QStringLiteral("Arial")), "000000", 0.0, 1.0, Qt::DotLine, Qt::SquareCap, true); m_defaultStyle[GeoDataFeature::HighwayTrack] = StyleBuilder::Private::createHighwayStyle( "highway_track", "#996600", QColor(Qt::white), QFont(QStringLiteral("Arial")), "000000", 1.0, 1.0, Qt::DashLine, Qt::SquareCap, true ); m_defaultStyle[GeoDataFeature::HighwayPedestrian] = StyleBuilder::Private::createHighwayStyle( "highway_pedestrian", "#dddde8", "#999", QFont(QStringLiteral("Arial")), "000000", 0.0, 2.0); m_defaultStyle[GeoDataFeature::HighwayFootway] = StyleBuilder::Private::createHighwayStyle( "highway_footway", "#fa8072", QColor(Qt::white), QFont(QStringLiteral("Arial")), "000000", 0.0, 2.0, Qt::DotLine, Qt::SquareCap, true); m_defaultStyle[GeoDataFeature::HighwayCycleway] = StyleBuilder::Private::createHighwayStyle( "highway_cycleway", QColor(Qt::blue), QColor(Qt::white), QFont(QStringLiteral("Arial")), "000000", 0.0, 2.0, Qt::DotLine, Qt::SquareCap, true); m_defaultStyle[GeoDataFeature::HighwayService] = StyleBuilder::Private::createHighwayStyle( "highway_service", "#ffffff", "#bbb", QFont(QStringLiteral("Arial")), "000000", 1.0, 6 ); m_defaultStyle[GeoDataFeature::HighwayResidential] = StyleBuilder::Private::createHighwayStyle( "highway_residential", "#ffffff", "#bbb", QFont(QStringLiteral("Arial")), "000000", 3, 6 ); m_defaultStyle[GeoDataFeature::HighwayLivingStreet] = StyleBuilder::Private::createHighwayStyle( "highway_living_street", "#ffffff", "#bbb", QFont(QStringLiteral("Arial")), "000000", 3, 6 ); m_defaultStyle[GeoDataFeature::HighwayRoad] = StyleBuilder::Private::createHighwayStyle( "highway_road", "#ddd", "#bbb", QFont(QStringLiteral("Arial")), "000000", 3, 6 ); m_defaultStyle[GeoDataFeature::HighwayUnclassified] = StyleBuilder::Private::createHighwayStyle( "highway_unclassified", "#ffffff", "#bbb", QFont(QStringLiteral("Arial")), "000000", 3, 6 ); m_defaultStyle[GeoDataFeature::HighwayTertiary] = StyleBuilder::Private::createHighwayStyle( "highway_tertiary", "#ffffff", "#8f8f8f", QFont(QStringLiteral("Arial")), "000000", 6.0, 6 ); m_defaultStyle[GeoDataFeature::HighwayTertiaryLink] = StyleBuilder::Private::createHighwayStyle( "highway_tertiary", "#ffffff", "#8f8f8f", QFont(QStringLiteral("Arial")), "000000", 6.0, 6 ); m_defaultStyle[GeoDataFeature::HighwaySecondary] = StyleBuilder::Private::createHighwayStyle( "highway_secondary", "#f7fabf", "#707d05", QFont(QStringLiteral("Arial")), "000000", 6.0, 6 ); m_defaultStyle[GeoDataFeature::HighwaySecondaryLink] = StyleBuilder::Private::createHighwayStyle( "highway_secondary", "#f7fabf", "#707d05", QFont(QStringLiteral("Arial")), "000000", 6.0, 6 ); m_defaultStyle[GeoDataFeature::HighwayPrimary] = StyleBuilder::Private::createHighwayStyle( "highway_primary", "#fcd6a4", "#a06b00", QFont(QStringLiteral("Arial")), "000000", 9.0, 6 ); m_defaultStyle[GeoDataFeature::HighwayPrimaryLink] = StyleBuilder::Private::createHighwayStyle( "highway_primary", "#fcd6a4", "#a06b00", QFont(QStringLiteral("Arial")), "000000", 6.0, 6 ); m_defaultStyle[GeoDataFeature::HighwayTrunk] = StyleBuilder::Private::createHighwayStyle( "highway_trunk", "#f9b29c", "#c84e2f", QFont(QStringLiteral("Arial")), "000000", 9.0, 6 ); m_defaultStyle[GeoDataFeature::HighwayTrunkLink] = StyleBuilder::Private::createHighwayStyle( "highway_trunk", "#f9b29c", "#c84e2f", QFont(QStringLiteral("Arial")), "000000", 9.0, 6 ); m_defaultStyle[GeoDataFeature::HighwayMotorway] = StyleBuilder::Private::createHighwayStyle( "highway_motorway", "#e892a2", "#dc2a67", QFont(QStringLiteral("Arial")), "000000", 9.0, 10 ); m_defaultStyle[GeoDataFeature::HighwayMotorwayLink] = StyleBuilder::Private::createHighwayStyle( "highway_motorway", "#e892a2", "#dc2a67", QFont(QStringLiteral("Arial")), "000000", 9.0, 10 ); m_defaultStyle[GeoDataFeature::TransportAirportRunway] = StyleBuilder::Private::createHighwayStyle( "", "#bbbbcc", "#bbbbcc", QFont(QStringLiteral("Arial")), "000000", 0, 1 ); + m_defaultStyle[GeoDataFeature::TransportAirportTaxiway] = StyleBuilder::Private::createHighwayStyle( "", "#bbbbcc", "#bbbbcc", QFont(QStringLiteral("Arial")), "000000", 0, 1 ); m_defaultStyle[GeoDataFeature::NaturalWater] = StyleBuilder::Private::createStyle( 4, 0, waterColor, waterColor, true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false, QVector< qreal >(), QFont(QStringLiteral("Arial")), waterColor.darker(150)); m_defaultStyle[GeoDataFeature::NaturalReef] = StyleBuilder::Private::createStyle( 5.5, 0, "#36677c", "#36677c", true, true, Qt::Dense7Pattern, Qt::DotLine, Qt::RoundCap, false, QVector< qreal >(), QFont(QStringLiteral("Arial")), waterColor.darker(150)); m_defaultStyle[GeoDataFeature::AmenityGraveyard] = StyleBuilder::Private::createWayStyle( "#AACBAF", "#AACBAF", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_generic.png") ); m_defaultStyle[GeoDataFeature::NaturalWood] = StyleBuilder::Private::createWayStyle( "#8DC46C", "#8DC46C", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/forest.png") ); m_defaultStyle[GeoDataFeature::NaturalBeach] = StyleBuilder::Private::createWayStyle( "#FFF1BA", "#FFF1BA", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/beach.png") ); m_defaultStyle[GeoDataFeature::NaturalWetland] = StyleBuilder::Private::createWayStyle( "#DDECEC", "#DDECEC", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/wetland.png") ); m_defaultStyle[GeoDataFeature::NaturalGlacier] = StyleBuilder::Private::createWayStyle( "#DDECEC", "#DDECEC", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/glacier.png") ); m_defaultStyle[GeoDataFeature::NaturalIceShelf] = StyleBuilder::Private::createWayStyle( "#8ebebe", "#8ebebe", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/glacier.png") ); m_defaultStyle[GeoDataFeature::NaturalScrub] = StyleBuilder::Private::createWayStyle( "#B5E3B5", "#B5E3B5", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/scrub.png") ); m_defaultStyle[GeoDataFeature::NaturalCliff] = StyleBuilder::Private::createWayStyle( Qt::transparent, Qt::transparent, true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/cliff2.png") ); m_defaultStyle[GeoDataFeature::NaturalHeath] = StyleBuilder::Private::createWayStyle( "#d6d99f", QColor("#d6d99f").darker(150), true, false ); m_defaultStyle[GeoDataFeature::LeisureGolfCourse] = StyleBuilder::Private::createWayStyle( QColor("#b5e3b5"), QColor("#b5e3b5").darker(150), true, true ); m_defaultStyle[GeoDataFeature::LeisureMarina] = StyleBuilder::Private::createOsmPOIStyle( osmFont, QString(), QColor("#95abd5"), QColor("#aec8d1"), QColor("#95abd5").darker(150) ); m_defaultStyle[GeoDataFeature::LeisurePark] = StyleBuilder::Private::createWayStyle( QColor("#c8facc"), QColor("#c8facc").darker(150), true, true ); m_defaultStyle[GeoDataFeature::LeisurePlayground] = StyleBuilder::Private::createOsmPOIStyle( osmFont, "amenity/playground.16", amenityColor, "#CCFFF1", "#BDFFED" ); m_defaultStyle[GeoDataFeature::LeisurePitch] = StyleBuilder::Private::createWayStyle( "#8ad3af", QColor("#8ad3af").darker(150), true, true ); m_defaultStyle[GeoDataFeature::LeisureSportsCentre] = StyleBuilder::Private::createWayStyle( "#33cc99", QColor("#33cc99").darker(150), true, true ); m_defaultStyle[GeoDataFeature::LeisureStadium] = StyleBuilder::Private::createWayStyle( "#33cc99", QColor("#33cc99").darker(150), true, true ); m_defaultStyle[GeoDataFeature::LeisureTrack] = StyleBuilder::Private::createWayStyle( "#74dcba", QColor("#74dcba").darker(150), true, true ); m_defaultStyle[GeoDataFeature::LeisureSwimmingPool] = StyleBuilder::Private::createWayStyle( waterColor, waterColor.darker(150), true, true ); m_defaultStyle[GeoDataFeature::LanduseAllotments] = StyleBuilder::Private::createWayStyle( "#E4C6AA", "#E4C6AA", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/allotments.png") ); m_defaultStyle[GeoDataFeature::LanduseBasin] = StyleBuilder::Private::createWayStyle( QColor(0xB5, 0xD0, 0xD0, 0x80 ), QColor( 0xB5, 0xD0, 0xD0 ) ); m_defaultStyle[GeoDataFeature::LanduseCemetery] = StyleBuilder::Private::createWayStyle( "#AACBAF", "#AACBAF", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_generic.png") ); m_defaultStyle[GeoDataFeature::LanduseCommercial] = StyleBuilder::Private::createWayStyle( "#F2DAD9", "#D1B2B0", true, true ); m_defaultStyle[GeoDataFeature::LanduseConstruction] = StyleBuilder::Private::createWayStyle( "#b6b592", "#b6b592", true, true ); m_defaultStyle[GeoDataFeature::LanduseFarmland] = StyleBuilder::Private::createWayStyle( "#EDDDC9", "#C8B69E", true, true ); m_defaultStyle[GeoDataFeature::LanduseFarmyard] = StyleBuilder::Private::createWayStyle( "#EFD6B5", "#D1B48C", true, true ); m_defaultStyle[GeoDataFeature::LanduseGarages] = StyleBuilder::Private::createWayStyle( "#E0DDCD", "#E0DDCD", true, true ); m_defaultStyle[GeoDataFeature::LanduseGrass] = StyleBuilder::Private::createWayStyle( "#A8C8A5", "#A8C8A5", true, true ); m_defaultStyle[GeoDataFeature::LanduseIndustrial] = StyleBuilder::Private::createWayStyle( "#DED0D5", "#DED0D5", true, true ); m_defaultStyle[GeoDataFeature::LanduseLandfill] = StyleBuilder::Private::createWayStyle( "#b6b592", "#b6b592", true, true ); m_defaultStyle[GeoDataFeature::LanduseMeadow] = StyleBuilder::Private::createWayStyle( "#cdebb0", "#cdebb0", true, true ); m_defaultStyle[GeoDataFeature::LanduseMilitary] = StyleBuilder::Private::createWayStyle( "#F3D8D2", "#F3D8D2", true, true, Qt::BDiagPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/military_red_hatch.png") ); m_defaultStyle[GeoDataFeature::LanduseQuarry] = StyleBuilder::Private::createWayStyle( "#C4C2C2", "#C4C2C2", true, true, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/quarry.png") ); m_defaultStyle[GeoDataFeature::LanduseRailway] = StyleBuilder::Private::createWayStyle( "#DED0D5", "#DED0D5", true, true ); m_defaultStyle[GeoDataFeature::LanduseReservoir] = StyleBuilder::Private::createWayStyle( waterColor, waterColor, true, true ); m_defaultStyle[GeoDataFeature::LanduseResidential] = StyleBuilder::Private::createWayStyle( "#DCDCDC", "#DCDCDC", true, true ); m_defaultStyle[GeoDataFeature::LanduseRetail] = StyleBuilder::Private::createWayStyle( "#FFD6D1", "#D99C95", true, true ); m_defaultStyle[GeoDataFeature::LanduseOrchard] = StyleBuilder::Private::createWayStyle( "#AEDFA3", "#AEDFA3", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/orchard.png") ); m_defaultStyle[GeoDataFeature::LanduseVineyard] = StyleBuilder::Private::createWayStyle( "#AEDFA3", "#AEDFA3", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/vineyard.png") ); m_defaultStyle[GeoDataFeature::MilitaryDangerArea] = StyleBuilder::Private::createWayStyle( "#FFC0CB", "#FFC0CB", true, false, Qt::SolidPattern, MarbleDirs::path("bitmaps/osmcarto/patterns/danger.png") ); m_defaultStyle[GeoDataFeature::RailwayRail] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#706E70", "#EEEEEE", true, true, Qt::SolidPattern, Qt::CustomDashLine, Qt::FlatCap, true, QVector< qreal >() << 2 << 3 ); m_defaultStyle[GeoDataFeature::RailwayNarrowGauge] = StyleBuilder::Private::createStyle( 2.0, 1.0, "#706E70", "#EEEEEE", true, true, Qt::SolidPattern, Qt::CustomDashLine, Qt::FlatCap, true, QVector< qreal >() << 2 << 3 ); // FIXME: the tram is currently being rendered as a polygon. m_defaultStyle[GeoDataFeature::RailwayTram] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#706E70", "#EEEEEE", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::RailwayLightRail] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#706E70", "#EEEEEE", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::RailwayAbandoned] = StyleBuilder::Private::createStyle( 2.0, 1.435, Qt::transparent, "#706E70", false, false, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::RailwaySubway] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#706E70", "#EEEEEE", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::RailwayPreserved] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#EEEEEE", "#706E70", true, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, true ); m_defaultStyle[GeoDataFeature::RailwayMiniature] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#706E70", "#EEEEEE", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::RailwayConstruction] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#EEEEEE", "#706E70", true, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, true ); m_defaultStyle[GeoDataFeature::RailwayMonorail] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#706E70", "#EEEEEE", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::RailwayFunicular] = StyleBuilder::Private::createStyle( 2.0, 1.435, "#706E70", "#EEEEEE", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::Building] = StyleBuilder::Private::createStyle( 1, 0, buildingColor, buildingColor.darker(), true, true, Qt::SolidPattern, Qt::SolidLine, Qt::RoundCap, false ); m_defaultStyle[GeoDataFeature::Landmass] = StyleBuilder::Private::createWayStyle( "#F1EEE8", "#F1EEE8", true, true ); m_defaultStyle[GeoDataFeature::UrbanArea] = StyleBuilder::Private::createWayStyle( "#E6E3DD", "#E6E3DD", true, true ); m_defaultStyle[GeoDataFeature::InternationalDateLine] = StyleBuilder::Private::createStyle( 1.0, 0.0, "#000000", "#000000", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::Bathymetry] = StyleBuilder::Private::createWayStyle( waterColor, waterColor, true, true ); m_defaultStyle[GeoDataFeature::AdminLevel1] = StyleBuilder::Private::createStyle(0.0, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::CustomDashLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel2] = StyleBuilder::Private::createStyle(2.0, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel3] = StyleBuilder::Private::createStyle(1.8, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DashLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel4] = StyleBuilder::Private::createStyle(1.5, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel5] = StyleBuilder::Private::createStyle(1.25, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DashDotDotLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel6] = StyleBuilder::Private::createStyle(1, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DashDotLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel7] = StyleBuilder::Private::createStyle(1, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DashLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel8] = StyleBuilder::Private::createStyle(1, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DashLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel9] = StyleBuilder::Private::createStyle(1.5, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel10] = StyleBuilder::Private::createStyle(1.5, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::AdminLevel11] = StyleBuilder::Private::createStyle(1.5, 0.0, "#DF9CCF", "#DF9CCF", false, true, Qt::SolidPattern, Qt::DotLine, Qt::FlatCap, false, QVector< qreal >() << 0.3 << 0.3 ); m_defaultStyle[GeoDataFeature::BoundaryMaritime] = StyleBuilder::Private::createStyle(2.0, 0.0, "#88b3bf", "#88b3bf", false, true, Qt::SolidPattern, Qt::SolidLine, Qt::FlatCap, false ); m_defaultStyle[GeoDataFeature::Satellite] = GeoDataStyle::Ptr(new GeoDataStyle( MarbleDirs::path( "bitmaps/satellite.png" ), QFont( defaultFamily, defaultSize, 50, false ), defaultLabelColor )); QFont tmp; // Fonts for areas ... tmp = m_defaultStyle[GeoDataFeature::Continent]->labelStyle().font(); tmp.setLetterSpacing( QFont::AbsoluteSpacing, 2 ); tmp.setCapitalization( QFont::AllUppercase ); tmp.setBold( true ); m_defaultStyle[GeoDataFeature::Continent]->labelStyle().setFont( tmp ); // Fonts for areas ... tmp = m_defaultStyle[GeoDataFeature::Mare]->labelStyle().font(); tmp.setLetterSpacing( QFont::AbsoluteSpacing, 2 ); tmp.setCapitalization( QFont::AllUppercase ); tmp.setBold( true ); m_defaultStyle[GeoDataFeature::Mare]->labelStyle().setFont( tmp ); // Now we need to underline the capitals ... tmp = m_defaultStyle[GeoDataFeature::SmallNationCapital]->labelStyle().font(); tmp.setUnderline( true ); m_defaultStyle[GeoDataFeature::SmallNationCapital]->labelStyle().setFont( tmp ); tmp = m_defaultStyle[GeoDataFeature::MediumNationCapital]->labelStyle().font(); tmp.setUnderline( true ); m_defaultStyle[GeoDataFeature::MediumNationCapital]->labelStyle().setFont( tmp ); tmp = m_defaultStyle[GeoDataFeature::BigNationCapital]->labelStyle().font(); tmp.setUnderline( true ); m_defaultStyle[GeoDataFeature::BigNationCapital]->labelStyle().setFont( tmp ); tmp = m_defaultStyle[GeoDataFeature::LargeNationCapital]->labelStyle().font(); tmp.setUnderline( true ); m_defaultStyle[GeoDataFeature::LargeNationCapital]->labelStyle().setFont( tmp ); } QString StyleBuilder::Private::createPaintLayerItem(const QString &itemType, GeoDataFeature::GeoDataVisualCategory visualCategory, const QString &subType) { QString const category = visualCategoryName(visualCategory); if (subType.isEmpty()) { return QString("%1/%2").arg(itemType).arg(category); } else { return QString("%1/%2/%3").arg(itemType).arg(category).arg(subType); } } StyleBuilder::StyleBuilder() : d(new Private) { // nothing to do } StyleBuilder::~StyleBuilder() { delete d; } QFont StyleBuilder::defaultFont() const { return d->m_defaultFont; } void StyleBuilder::setDefaultFont( const QFont& font ) { d->m_defaultFont = font; reset(); } QColor StyleBuilder::defaultLabelColor() const { return d->m_defaultLabelColor; } void StyleBuilder::setDefaultLabelColor( const QColor& color ) { d->m_defaultLabelColor = color; reset(); } GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters ¶meters) const { if (!parameters.feature) { Q_ASSERT(false && "Must not pass a null feature to StyleBuilder::createStyle"); return GeoDataStyle::Ptr(); } if (parameters.feature->customStyle()) { return parameters.feature->customStyle(); } auto const visualCategory = parameters.feature->visualCategory(); GeoDataStyle::ConstPtr style = presetStyle(visualCategory); if (parameters.feature->nodeType() != GeoDataTypes::GeoDataPlacemarkType) { return style; } GeoDataPlacemark const * placemark = static_cast(parameters.feature); OsmPlacemarkData const & osmData = placemark->osmData(); if (placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPointType) { if (visualCategory == GeoDataFeature::NaturalTree) { GeoDataCoordinates const coordinates = placemark->coordinate(); qreal const lat = coordinates.latitude(GeoDataCoordinates::Degree); if (qAbs(lat) > 15) { /** @todo Should maybe auto-adjust to MarbleClock at some point */ int const month = QDate::currentDate().month(); QString season; bool const southernHemisphere = lat < 0; if (southernHemisphere) { if (month >= 3 && month <= 5) { season = "autumn"; } else if (month >= 6 && month <= 8) { season = "winter"; } } else { if (month >= 9 && month <= 11) { season = "autumn"; } else if (month == 12 || month == 1 || month == 2) { season = "winter"; } } if (!season.isEmpty()) { GeoDataIconStyle iconStyle = style->iconStyle(); QString const image = QString("svg/osmcarto/svg/individual/tree-29-%1.svg").arg(season); iconStyle.setIconPath(MarbleDirs::path(image)); GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style)); newStyle->setIconStyle(iconStyle); style = newStyle; } } } } else if (placemark->geometry()->nodeType() == GeoDataTypes::GeoDataLinearRingType) { bool adjustStyle = false; GeoDataPolyStyle polyStyle = style->polyStyle(); GeoDataLineStyle lineStyle = style->lineStyle(); if (visualCategory == GeoDataFeature::NaturalWater) { if( osmData.containsTag("salt","yes") ){ polyStyle.setColor("#ffff80"); lineStyle.setPenStyle(Qt::DashLine); lineStyle.setWidth(2); adjustStyle = true; } } else if (visualCategory == GeoDataFeature::Bathymetry) { if (osmData.containsTagKey("ele")) { QString elevation = osmData.tagValue("ele"); if (elevation == "4000") { polyStyle.setColor("#a5c9c9"); lineStyle.setColor("#a5c9c9"); adjustStyle = true; } } } else if (visualCategory == GeoDataFeature::AmenityGraveyard || visualCategory == GeoDataFeature::LanduseCemetery) { if( osmData.containsTag("religion","jewish") ){ polyStyle.setTexturePath(MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_jewish.png")); adjustStyle = true; } else if( osmData.containsTag("religion","christian") ){ polyStyle.setTexturePath(MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_christian.png")); adjustStyle = true; } else if( osmData.containsTag("religion","INT-generic") ){ polyStyle.setTexturePath(MarbleDirs::path("bitmaps/osmcarto/patterns/grave_yard_generic.png")); adjustStyle = true; } } else if (visualCategory == GeoDataFeature::HighwayPedestrian) { polyStyle.setOutline(false); adjustStyle = true; } if (adjustStyle) { GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style)); newStyle->setPolyStyle(polyStyle); newStyle->setLineStyle(lineStyle); style = newStyle; } if (style->iconStyle().iconPath().isEmpty()) { for (auto iter = osmData.tagsBegin(), end = osmData.tagsEnd(); iter != end; ++iter) { const QString keyValue = QString("%1=%2").arg(iter.key()).arg(iter.value()); const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(keyValue); const GeoDataStyle::ConstPtr categoryStyle = presetStyle(category); if (category != GeoDataFeature::None && !categoryStyle->iconStyle().icon().isNull()) { GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style)); newStyle->setIconStyle(categoryStyle->iconStyle()); style = newStyle; break; } } } } else if (placemark->geometry()->nodeType() == GeoDataTypes::GeoDataLineStringType) { GeoDataPolyStyle polyStyle = style->polyStyle(); GeoDataLineStyle lineStyle = style->lineStyle(); lineStyle.setCosmeticOutline(true); if(visualCategory == GeoDataFeature::AdminLevel2){ if (osmData.containsTag("maritime", "yes") ) { lineStyle.setColor("#88b3bf"); polyStyle.setColor("#88b3bf"); if( osmData.containsTag("marble:disputed", "yes") ){ lineStyle.setPenStyle( Qt::DashLine ); } } } else if ((visualCategory >= GeoDataFeature::HighwayService && visualCategory <= GeoDataFeature::HighwayMotorway) || visualCategory == GeoDataFeature::TransportAirportRunway) { if (parameters.tileLevel >= 0 && parameters.tileLevel <= 7) { /** @todo: Dummy implementation for dynamic style changes based on tile level, replace with sane values */ lineStyle.setPhysicalWidth(0.0); lineStyle.setWidth(3.0); } else if (parameters.tileLevel >= 0 && parameters.tileLevel <= 9) { /** @todo: Dummy implementation for dynamic style changes based on tile level, replace with sane values */ lineStyle.setPhysicalWidth(0.0); lineStyle.setWidth(4.0); } else { if (osmData.containsTagKey("width")) { QString const widthValue = osmData.tagValue("width").remove(QStringLiteral(" meters")).remove(QStringLiteral(" m")); bool ok; float const width = widthValue.toFloat(&ok); lineStyle.setPhysicalWidth(ok ? qBound(0.1f, width, 200.0f) : 0.0f); } else { bool const isOneWay = osmData.containsTag("oneway", "yes") || osmData.containsTag("oneway", "-1"); 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 double const laneWidth = 3.0; double const margins = visualCategory == GeoDataFeature::HighwayMotorway ? 2.0 : (isOneWay ? 1.0 : 0.0); double const physicalWidth = margins + lanes * laneWidth; lineStyle.setPhysicalWidth(physicalWidth); } } QString const accessValue = osmData.tagValue("access"); if (accessValue == "private" || accessValue == "no" || accessValue == "agricultural" || accessValue == "delivery" || accessValue == "forestry") { QColor polyColor = polyStyle.color(); qreal hue, sat, val; polyColor.getHsvF(&hue, &sat, &val); polyColor.setHsvF(0.98, qMin(1.0, 0.2 + sat), val); polyStyle.setColor(polyColor); lineStyle.setColor(lineStyle.color().darker(150)); } if (osmData.containsTag("tunnel", "yes") ) { QColor polyColor = polyStyle.color(); qreal hue, sat, val; polyColor.getHsvF(&hue, &sat, &val); polyColor.setHsvF(hue, 0.25 * sat, 0.95 * val); polyStyle.setColor(polyColor); lineStyle.setColor(lineStyle.color().lighter(115)); } } else if (visualCategory == GeoDataFeature::NaturalWater) { if (parameters.tileLevel >= 0 && parameters.tileLevel <= 7) { lineStyle.setWidth(parameters.tileLevel <= 3 ? 1 : 2); lineStyle.setPhysicalWidth(0.0); } else { QString const widthValue = osmData.tagValue("width").remove(QStringLiteral(" meters")).remove(QStringLiteral(" m")); bool ok; float const width = widthValue.toFloat(&ok); lineStyle.setPhysicalWidth(ok ? qBound(0.1f, width, 200.0f) : 0.0f); } } GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style)); newStyle->setPolyStyle(polyStyle); newStyle->setLineStyle(lineStyle); bool const hideLabel = visualCategory == GeoDataFeature::HighwayTrack || (visualCategory >= GeoDataFeature::RailwayRail && visualCategory <= GeoDataFeature::RailwayFunicular); if (hideLabel) { newStyle->labelStyle().setColor(QColor(Qt::transparent)); } style = newStyle; } else if (placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPolygonType) { GeoDataPolyStyle polyStyle = style->polyStyle(); GeoDataLineStyle lineStyle = style->lineStyle(); bool adjustStyle = false; if (visualCategory == GeoDataFeature::Bathymetry) { if (osmData.containsTagKey("ele")) { QString elevation = osmData.tagValue("ele"); if (elevation == "4000") { polyStyle.setColor("#a5c9c9"); lineStyle.setColor("#a5c9c9"); adjustStyle = true; } } } else if (visualCategory == GeoDataFeature::HighwayPedestrian) { polyStyle.setOutline(false); adjustStyle = true; } if (adjustStyle) { GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style)); newStyle->setPolyStyle(polyStyle); newStyle->setLineStyle(lineStyle); style = newStyle; } } return style; } GeoDataStyle::ConstPtr StyleBuilder::presetStyle(GeoDataFeature::GeoDataVisualCategory visualCategory) const { if (!d->m_defaultStyleInitialized) { d->initializeDefaultStyles(); } if (visualCategory != GeoDataFeature::None && d->m_defaultStyle[visualCategory] ) { return d->m_defaultStyle[visualCategory]; } else { return d->m_defaultStyle[GeoDataFeature::Default]; } } QStringList StyleBuilder::renderOrder() const { static QStringList paintLayerOrder; if (paintLayerOrder.isEmpty()) { paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::Landmass); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::UrbanArea); for ( int i = GeoDataFeature::LanduseAllotments; i <= GeoDataFeature::LanduseVineyard; i++ ) { if ((GeoDataFeature::GeoDataVisualCategory)i != GeoDataFeature::LanduseGrass) { paintLayerOrder << Private::createPaintLayerItem("Polygon", (GeoDataFeature::GeoDataVisualCategory)i); } } paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::Bathymetry); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalBeach); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalWetland); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalGlacier); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalIceShelf); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalCliff); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalPeak); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::MilitaryDangerArea); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::LeisurePark); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::LeisurePitch); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::LeisureSportsCentre); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::LeisureStadium); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalWood); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::LanduseGrass); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::HighwayPedestrian); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::LeisurePlayground); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalScrub); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::LeisureTrack); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::TransportParking); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::TransportParkingSpace); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::ManmadeBridge); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::BarrierCityWall); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::AmenityGraveyard); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::AmenityKindergarten); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::EducationCollege); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::EducationSchool); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::EducationUniversity); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::HealthHospital); paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataFeature::Landmass); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::NaturalWater); paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataFeature::NaturalWater, "outline"); paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataFeature::NaturalWater, "inline"); paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataFeature::NaturalWater, "label"); paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataFeature::NaturalReef, "outline"); paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataFeature::NaturalReef, "inline"); paintLayerOrder << Private::createPaintLayerItem("LineString", GeoDataFeature::NaturalReef, "label"); paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::LeisureMarina); for ( int i = GeoDataFeature::HighwaySteps; i <= GeoDataFeature::HighwayMotorway; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "outline"); } for ( int i = GeoDataFeature::HighwaySteps; i <= GeoDataFeature::HighwayMotorway; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "inline"); } for ( int i = GeoDataFeature::HighwaySteps; i <= GeoDataFeature::HighwayMotorway; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "label"); } for ( int i = GeoDataFeature::RailwayRail; i <= GeoDataFeature::RailwayFunicular; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "outline"); } for ( int i = GeoDataFeature::RailwayRail; i <= GeoDataFeature::RailwayFunicular; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "inline"); } for ( int i = GeoDataFeature::RailwayRail; i <= GeoDataFeature::RailwayFunicular; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "label"); } paintLayerOrder << Private::createPaintLayerItem("Polygon", GeoDataFeature::TransportPlatform); for ( int i = GeoDataFeature::AdminLevel1; i <= GeoDataFeature::AdminLevel11; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "outline"); } for ( int i = GeoDataFeature::AdminLevel1; i <= GeoDataFeature::AdminLevel11; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "inline"); } for ( int i = GeoDataFeature::AdminLevel1; i <= GeoDataFeature::AdminLevel11; i++ ) { paintLayerOrder << Private::createPaintLayerItem("LineString", (GeoDataFeature::GeoDataVisualCategory)i, "label"); } paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::Bathymetry); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::AmenityGraveyard); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalWood); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalBeach); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalWetland); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalGlacier); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalIceShelf); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalScrub); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::LeisureMarina); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::LeisurePark); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::LeisurePlayground); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::LeisurePitch); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::LeisureSportsCentre); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::LeisureStadium); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::LeisureTrack); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::TransportParking); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::ManmadeBridge); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::BarrierCityWall); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalWater); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalReef); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::Landmass); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalCliff); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::NaturalPeak); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::AmenityKindergarten); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::EducationCollege); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::EducationSchool); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::EducationUniversity); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::HealthHospital); paintLayerOrder << Private::createPaintLayerItem("Point", GeoDataFeature::MilitaryDangerArea); paintLayerOrder << "Polygon/Building/frame"; paintLayerOrder << "Polygon/Building/roof"; Q_ASSERT(QSet::fromList(paintLayerOrder).size() == paintLayerOrder.size()); } return paintLayerOrder; } void StyleBuilder::reset() { d->m_defaultStyleInitialized = false; } int StyleBuilder::minimumZoomLevel(GeoDataFeature::GeoDataVisualCategory category) const { return d->m_defaultMinZoomLevels[category]; } int StyleBuilder::maximumZoomLevel() const { return d->m_maximumZoomLevel; } QString StyleBuilder::visualCategoryName(GeoDataFeature::GeoDataVisualCategory category) { static QHash visualCategoryNames; if (visualCategoryNames.isEmpty()) { visualCategoryNames[GeoDataFeature::GeoDataFeature::None] = "None"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Default] = "Default"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Unknown] = "Unknown"; visualCategoryNames[GeoDataFeature::GeoDataFeature::SmallCity] = "SmallCity"; visualCategoryNames[GeoDataFeature::GeoDataFeature::SmallCountyCapital] = "SmallCountyCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::SmallStateCapital] = "SmallStateCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::SmallNationCapital] = "SmallNationCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::MediumCity] = "MediumCity"; visualCategoryNames[GeoDataFeature::GeoDataFeature::MediumCountyCapital] = "MediumCountyCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::MediumStateCapital] = "MediumStateCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::MediumNationCapital] = "MediumNationCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::BigCity] = "BigCity"; visualCategoryNames[GeoDataFeature::GeoDataFeature::BigCountyCapital] = "BigCountyCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::BigStateCapital] = "BigStateCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::BigNationCapital] = "BigNationCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::LargeCity] = "LargeCity"; visualCategoryNames[GeoDataFeature::GeoDataFeature::LargeCountyCapital] = "LargeCountyCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::LargeStateCapital] = "LargeStateCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::LargeNationCapital] = "LargeNationCapital"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Nation] = "Nation"; visualCategoryNames[GeoDataFeature::GeoDataFeature::PlaceCity] = "PlaceCity"; visualCategoryNames[GeoDataFeature::GeoDataFeature::PlaceSuburb] = "PlaceSuburb"; visualCategoryNames[GeoDataFeature::GeoDataFeature::PlaceHamlet] = "PlaceHamlet"; visualCategoryNames[GeoDataFeature::GeoDataFeature::PlaceLocality] = "PlaceLocality"; visualCategoryNames[GeoDataFeature::GeoDataFeature::PlaceTown] = "PlaceTown"; visualCategoryNames[GeoDataFeature::GeoDataFeature::PlaceVillage] = "PlaceVillage"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Mountain] = "Mountain"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Volcano] = "Volcano"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Mons] = "Mons"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Valley] = "Valley"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Continent] = "Continent"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Ocean] = "Ocean"; visualCategoryNames[GeoDataFeature::GeoDataFeature::OtherTerrain] = "OtherTerrain"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Crater] = "Crater"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Mare] = "Mare"; visualCategoryNames[GeoDataFeature::GeoDataFeature::GeographicPole] = "GeographicPole"; visualCategoryNames[GeoDataFeature::GeoDataFeature::MagneticPole] = "MagneticPole"; visualCategoryNames[GeoDataFeature::GeoDataFeature::ShipWreck] = "ShipWreck"; visualCategoryNames[GeoDataFeature::GeoDataFeature::AirPort] = "AirPort"; visualCategoryNames[GeoDataFeature::GeoDataFeature::Observatory] = "Observatory"; visualCategoryNames[GeoDataFeature::GeoDataFeature::MilitaryDangerArea] = "MilitaryDangerArea"; visualCategoryNames[GeoDataFeature::GeoDataFeature::OsmSite] = "OsmSite"; visualCategoryNames[GeoDataFeature::Coordinate] = "Coordinate"; visualCategoryNames[GeoDataFeature::MannedLandingSite] = "MannedLandingSite"; visualCategoryNames[GeoDataFeature::RoboticRover] = "RoboticRover"; visualCategoryNames[GeoDataFeature::UnmannedSoftLandingSite] = "UnmannedSoftLandingSite"; visualCategoryNames[GeoDataFeature::UnmannedHardLandingSite] = "UnmannedHardLandingSite"; visualCategoryNames[GeoDataFeature::Folder] = "Folder"; visualCategoryNames[GeoDataFeature::Bookmark] = "Bookmark"; visualCategoryNames[GeoDataFeature::NaturalWater] = "NaturalWater"; visualCategoryNames[GeoDataFeature::NaturalReef] = "NaturalReef"; visualCategoryNames[GeoDataFeature::NaturalWood] = "NaturalWood"; visualCategoryNames[GeoDataFeature::NaturalBeach] = "NaturalBeach"; visualCategoryNames[GeoDataFeature::NaturalWetland] = "NaturalWetland"; visualCategoryNames[GeoDataFeature::NaturalGlacier] = "NaturalGlacier"; visualCategoryNames[GeoDataFeature::NaturalIceShelf] = "NaturalIceShelf"; visualCategoryNames[GeoDataFeature::NaturalScrub] = "NaturalScrub"; visualCategoryNames[GeoDataFeature::NaturalCliff] = "NaturalCliff"; visualCategoryNames[GeoDataFeature::NaturalHeath] = "NaturalHeath"; visualCategoryNames[GeoDataFeature::HighwayTrafficSignals] = "HighwayTrafficSignals"; visualCategoryNames[GeoDataFeature::HighwaySteps] = "HighwaySteps"; visualCategoryNames[GeoDataFeature::HighwayUnknown] = "HighwayUnknown"; visualCategoryNames[GeoDataFeature::HighwayPath] = "HighwayPath"; visualCategoryNames[GeoDataFeature::HighwayFootway] = "HighwayFootway"; visualCategoryNames[GeoDataFeature::HighwayTrack] = "HighwayTrack"; visualCategoryNames[GeoDataFeature::HighwayPedestrian] = "HighwayPedestrian"; visualCategoryNames[GeoDataFeature::HighwayCycleway] = "HighwayCycleway"; visualCategoryNames[GeoDataFeature::HighwayService] = "HighwayService"; visualCategoryNames[GeoDataFeature::HighwayRoad] = "HighwayRoad"; visualCategoryNames[GeoDataFeature::HighwayResidential] = "HighwayResidential"; visualCategoryNames[GeoDataFeature::HighwayLivingStreet] = "HighwayLivingStreet"; visualCategoryNames[GeoDataFeature::HighwayUnclassified] = "HighwayUnclassified"; visualCategoryNames[GeoDataFeature::HighwayTertiaryLink] = "HighwayTertiaryLink"; visualCategoryNames[GeoDataFeature::HighwayTertiary] = "HighwayTertiary"; visualCategoryNames[GeoDataFeature::HighwaySecondaryLink] = "HighwaySecondaryLink"; visualCategoryNames[GeoDataFeature::HighwaySecondary] = "HighwaySecondary"; visualCategoryNames[GeoDataFeature::HighwayPrimaryLink] = "HighwayPrimaryLink"; visualCategoryNames[GeoDataFeature::HighwayPrimary] = "HighwayPrimary"; visualCategoryNames[GeoDataFeature::HighwayTrunkLink] = "HighwayTrunkLink"; visualCategoryNames[GeoDataFeature::HighwayTrunk] = "HighwayTrunk"; visualCategoryNames[GeoDataFeature::HighwayMotorwayLink] = "HighwayMotorwayLink"; visualCategoryNames[GeoDataFeature::HighwayMotorway] = "HighwayMotorway"; visualCategoryNames[GeoDataFeature::Building] = "Building"; visualCategoryNames[GeoDataFeature::AccomodationCamping] = "AccomodationCamping"; visualCategoryNames[GeoDataFeature::AccomodationHostel] = "AccomodationHostel"; visualCategoryNames[GeoDataFeature::AccomodationHotel] = "AccomodationHotel"; visualCategoryNames[GeoDataFeature::AccomodationMotel] = "AccomodationMotel"; visualCategoryNames[GeoDataFeature::AccomodationYouthHostel] = "AccomodationYouthHostel"; visualCategoryNames[GeoDataFeature::AccomodationGuestHouse] = "AccomodationGuestHouse"; visualCategoryNames[GeoDataFeature::AmenityLibrary] = "AmenityLibrary"; visualCategoryNames[GeoDataFeature::AmenityKindergarten] = "AmenityKindergarten"; visualCategoryNames[GeoDataFeature::EducationCollege] = "EducationCollege"; visualCategoryNames[GeoDataFeature::EducationSchool] = "EducationSchool"; visualCategoryNames[GeoDataFeature::EducationUniversity] = "EducationUniversity"; visualCategoryNames[GeoDataFeature::FoodBar] = "FoodBar"; visualCategoryNames[GeoDataFeature::FoodBiergarten] = "FoodBiergarten"; visualCategoryNames[GeoDataFeature::FoodCafe] = "FoodCafe"; visualCategoryNames[GeoDataFeature::FoodFastFood] = "FoodFastFood"; visualCategoryNames[GeoDataFeature::FoodPub] = "FoodPub"; visualCategoryNames[GeoDataFeature::FoodRestaurant] = "FoodRestaurant"; visualCategoryNames[GeoDataFeature::HealthDentist] = "HealthDentist"; visualCategoryNames[GeoDataFeature::HealthDoctors] = "HealthDoctors"; visualCategoryNames[GeoDataFeature::HealthHospital] = "HealthHospital"; visualCategoryNames[GeoDataFeature::HealthPharmacy] = "HealthPharmacy"; visualCategoryNames[GeoDataFeature::HealthVeterinary] = "HealthVeterinary"; visualCategoryNames[GeoDataFeature::MoneyAtm] = "MoneyAtm"; visualCategoryNames[GeoDataFeature::MoneyBank] = "MoneyBank"; visualCategoryNames[GeoDataFeature::AmenityArchaeologicalSite] = "AmenityArchaeologicalSite"; visualCategoryNames[GeoDataFeature::AmenityEmbassy] = "AmenityEmbassy"; visualCategoryNames[GeoDataFeature::AmenityEmergencyPhone] = "AmenityEmergencyPhone"; visualCategoryNames[GeoDataFeature::AmenityWaterPark] = "AmenityWaterPark"; visualCategoryNames[GeoDataFeature::AmenityCommunityCentre] = "AmenityCommunityCentre"; visualCategoryNames[GeoDataFeature::AmenityFountain] = "AmenityFountain"; visualCategoryNames[GeoDataFeature::AmenityNightClub] = "AmenityNightClub"; visualCategoryNames[GeoDataFeature::AmenityBench] = "AmenityBench"; visualCategoryNames[GeoDataFeature::AmenityCourtHouse] = "AmenityCourtHouse"; visualCategoryNames[GeoDataFeature::AmenityFireStation] = "AmenityFireStation"; visualCategoryNames[GeoDataFeature::AmenityHuntingStand] = "AmenityHuntingStand"; visualCategoryNames[GeoDataFeature::AmenityPolice] = "AmenityPolice"; visualCategoryNames[GeoDataFeature::AmenityPostBox] = "AmenityPostBox"; visualCategoryNames[GeoDataFeature::AmenityPostOffice] = "AmenityPostOffice"; visualCategoryNames[GeoDataFeature::AmenityPrison] = "AmenityPrison"; visualCategoryNames[GeoDataFeature::AmenityRecycling] = "AmenityRecycling"; visualCategoryNames[GeoDataFeature::AmenityShelter] = "AmenityShelter"; visualCategoryNames[GeoDataFeature::AmenityTelephone] = "AmenityTelephone"; visualCategoryNames[GeoDataFeature::AmenityToilets] = "AmenityToilets"; visualCategoryNames[GeoDataFeature::AmenityTownHall] = "AmenityTownHall"; visualCategoryNames[GeoDataFeature::AmenityWasteBasket] = "AmenityWasteBasket"; visualCategoryNames[GeoDataFeature::AmenityDrinkingWater] = "AmenityDrinkingWater"; visualCategoryNames[GeoDataFeature::AmenityGraveyard] = "AmenityGraveyard"; visualCategoryNames[GeoDataFeature::BarrierCityWall] = "BarrierCityWall"; visualCategoryNames[GeoDataFeature::BarrierGate] = "BarrierGate"; visualCategoryNames[GeoDataFeature::BarrierLiftGate] = "BarrierLiftGate"; visualCategoryNames[GeoDataFeature::BarrierWall] = "BarrierWall"; visualCategoryNames[GeoDataFeature::NaturalPeak] = "NaturalPeak"; visualCategoryNames[GeoDataFeature::NaturalTree] = "NaturalTree"; visualCategoryNames[GeoDataFeature::ShopBeverages] = "ShopBeverages"; visualCategoryNames[GeoDataFeature::ShopHifi] = "ShopHifi"; visualCategoryNames[GeoDataFeature::ShopSupermarket] = "ShopSupermarket"; visualCategoryNames[GeoDataFeature::ShopAlcohol] = "ShopAlcohol"; visualCategoryNames[GeoDataFeature::ShopBakery] = "ShopBakery"; visualCategoryNames[GeoDataFeature::ShopButcher] = "ShopButcher"; visualCategoryNames[GeoDataFeature::ShopConfectionery] = "ShopConfectionery"; visualCategoryNames[GeoDataFeature::ShopConvenience] = "ShopConvenience"; visualCategoryNames[GeoDataFeature::ShopGreengrocer] = "ShopGreengrocer"; visualCategoryNames[GeoDataFeature::ShopSeafood] = "ShopSeafood"; visualCategoryNames[GeoDataFeature::ShopDepartmentStore] = "ShopDepartmentStore"; visualCategoryNames[GeoDataFeature::ShopKiosk] = "ShopKiosk"; visualCategoryNames[GeoDataFeature::ShopBag] = "ShopBag"; visualCategoryNames[GeoDataFeature::ShopClothes] = "ShopClothes"; visualCategoryNames[GeoDataFeature::ShopFashion] = "ShopFashion"; visualCategoryNames[GeoDataFeature::ShopJewelry] = "ShopJewelry"; visualCategoryNames[GeoDataFeature::ShopShoes] = "ShopShoes"; visualCategoryNames[GeoDataFeature::ShopVarietyStore] = "ShopVarietyStore"; visualCategoryNames[GeoDataFeature::ShopBeauty] = "ShopBeauty"; visualCategoryNames[GeoDataFeature::ShopChemist] = "ShopChemist"; visualCategoryNames[GeoDataFeature::ShopCosmetics] = "ShopCosmetics"; visualCategoryNames[GeoDataFeature::ShopHairdresser] = "ShopHairdresser"; visualCategoryNames[GeoDataFeature::ShopOptician] = "ShopOptician"; visualCategoryNames[GeoDataFeature::ShopPerfumery] = "ShopPerfumery"; visualCategoryNames[GeoDataFeature::ShopDoitYourself] = "ShopDoitYourself"; visualCategoryNames[GeoDataFeature::ShopFlorist] = "ShopFlorist"; visualCategoryNames[GeoDataFeature::ShopHardware] = "ShopHardware"; visualCategoryNames[GeoDataFeature::ShopFurniture] = "ShopFurniture"; visualCategoryNames[GeoDataFeature::ShopElectronics] = "ShopElectronics"; visualCategoryNames[GeoDataFeature::ShopMobilePhone] = "ShopMobilePhone"; visualCategoryNames[GeoDataFeature::ShopBicycle] = "ShopBicycle"; visualCategoryNames[GeoDataFeature::ShopCar] = "ShopCar"; visualCategoryNames[GeoDataFeature::ShopCarRepair] = "ShopCarRepair"; visualCategoryNames[GeoDataFeature::ShopCarParts] = "ShopCarParts"; visualCategoryNames[GeoDataFeature::ShopMotorcycle] = "ShopMotorcycle"; visualCategoryNames[GeoDataFeature::ShopOutdoor] = "ShopOutdoor"; visualCategoryNames[GeoDataFeature::ShopMusicalInstrument] = "ShopMusicalInstrument"; visualCategoryNames[GeoDataFeature::ShopPhoto] = "ShopPhoto"; visualCategoryNames[GeoDataFeature::ShopBook] = "ShopBook"; visualCategoryNames[GeoDataFeature::ShopGift] = "ShopGift"; visualCategoryNames[GeoDataFeature::ShopStationery] = "ShopStationery"; visualCategoryNames[GeoDataFeature::ShopLaundry] = "ShopLaundry"; visualCategoryNames[GeoDataFeature::ShopPet] = "ShopPet"; visualCategoryNames[GeoDataFeature::ShopToys] = "ShopToys"; visualCategoryNames[GeoDataFeature::ShopTravelAgency] = "ShopTravelAgency"; visualCategoryNames[GeoDataFeature::Shop] = "Shop"; visualCategoryNames[GeoDataFeature::ManmadeBridge] = "ManmadeBridge"; visualCategoryNames[GeoDataFeature::ManmadeLighthouse] = "ManmadeLighthouse"; visualCategoryNames[GeoDataFeature::ManmadePier] = "ManmadePier"; visualCategoryNames[GeoDataFeature::ManmadeWaterTower] = "ManmadeWaterTower"; visualCategoryNames[GeoDataFeature::ManmadeWindMill] = "ManmadeWindMill"; visualCategoryNames[GeoDataFeature::TouristAttraction] = "TouristAttraction"; visualCategoryNames[GeoDataFeature::TouristCastle] = "TouristCastle"; visualCategoryNames[GeoDataFeature::TouristCinema] = "TouristCinema"; visualCategoryNames[GeoDataFeature::TouristInformation] = "TouristInformation"; visualCategoryNames[GeoDataFeature::TouristMonument] = "TouristMonument"; visualCategoryNames[GeoDataFeature::TouristMuseum] = "TouristMuseum"; visualCategoryNames[GeoDataFeature::TouristRuin] = "TouristRuin"; visualCategoryNames[GeoDataFeature::TouristTheatre] = "TouristTheatre"; visualCategoryNames[GeoDataFeature::TouristThemePark] = "TouristThemePark"; visualCategoryNames[GeoDataFeature::TouristViewPoint] = "TouristViewPoint"; visualCategoryNames[GeoDataFeature::TouristZoo] = "TouristZoo"; visualCategoryNames[GeoDataFeature::TouristAlpineHut] = "TouristAlpineHut"; visualCategoryNames[GeoDataFeature::TransportAerodrome] = "TransportAerodrome"; visualCategoryNames[GeoDataFeature::TransportHelipad] = "TransportHelipad"; visualCategoryNames[GeoDataFeature::TransportAirportTerminal] = "TransportAirportTerminal"; visualCategoryNames[GeoDataFeature::TransportAirportGate] = "TransportAirportGate"; visualCategoryNames[GeoDataFeature::TransportAirportRunway] = "TransportAirportRunway"; visualCategoryNames[GeoDataFeature::TransportBusStation] = "TransportBusStation"; visualCategoryNames[GeoDataFeature::TransportBusStop] = "TransportBusStop"; visualCategoryNames[GeoDataFeature::TransportCarShare] = "TransportCarShare"; visualCategoryNames[GeoDataFeature::TransportFuel] = "TransportFuel"; visualCategoryNames[GeoDataFeature::TransportParking] = "TransportParking"; visualCategoryNames[GeoDataFeature::TransportParkingSpace] = "TransportParkingSpace"; visualCategoryNames[GeoDataFeature::TransportPlatform] = "TransportPlatform"; visualCategoryNames[GeoDataFeature::TransportRentalBicycle] = "TransportRentalBicycle"; visualCategoryNames[GeoDataFeature::TransportRentalCar] = "TransportRentalCar"; visualCategoryNames[GeoDataFeature::TransportTaxiRank] = "TransportTaxiRank"; visualCategoryNames[GeoDataFeature::TransportTrainStation] = "TransportTrainStation"; visualCategoryNames[GeoDataFeature::TransportTramStop] = "TransportTramStop"; visualCategoryNames[GeoDataFeature::TransportBicycleParking] = "TransportBicycleParking"; visualCategoryNames[GeoDataFeature::TransportMotorcycleParking] = "TransportMotorcycleParking"; visualCategoryNames[GeoDataFeature::TransportSubwayEntrance] = "TransportSubwayEntrance"; visualCategoryNames[GeoDataFeature::ReligionPlaceOfWorship] = "ReligionPlaceOfWorship"; visualCategoryNames[GeoDataFeature::ReligionBahai] = "ReligionBahai"; visualCategoryNames[GeoDataFeature::ReligionBuddhist] = "ReligionBuddhist"; visualCategoryNames[GeoDataFeature::ReligionChristian] = "ReligionChristian"; visualCategoryNames[GeoDataFeature::ReligionMuslim] = "ReligionMuslim"; visualCategoryNames[GeoDataFeature::ReligionHindu] = "ReligionHindu"; visualCategoryNames[GeoDataFeature::ReligionJain] = "ReligionJain"; visualCategoryNames[GeoDataFeature::ReligionJewish] = "ReligionJewish"; visualCategoryNames[GeoDataFeature::ReligionShinto] = "ReligionShinto"; visualCategoryNames[GeoDataFeature::ReligionSikh] = "ReligionSikh"; visualCategoryNames[GeoDataFeature::LeisureGolfCourse] = "LeisureGolfCourse"; visualCategoryNames[GeoDataFeature::LeisureMarina] = "LeisureMarina"; visualCategoryNames[GeoDataFeature::LeisurePark] = "LeisurePark"; visualCategoryNames[GeoDataFeature::LeisurePlayground] = "LeisurePlayground"; visualCategoryNames[GeoDataFeature::LeisurePitch] = "LeisurePitch"; visualCategoryNames[GeoDataFeature::LeisureSportsCentre] = "LeisureSportsCentre"; visualCategoryNames[GeoDataFeature::LeisureStadium] = "LeisureStadium"; visualCategoryNames[GeoDataFeature::LeisureTrack] = "LeisureTrack"; visualCategoryNames[GeoDataFeature::LeisureSwimmingPool] = "LeisureSwimmingPool"; visualCategoryNames[GeoDataFeature::LanduseAllotments] = "LanduseAllotments"; visualCategoryNames[GeoDataFeature::LanduseBasin] = "LanduseBasin"; visualCategoryNames[GeoDataFeature::LanduseCemetery] = "LanduseCemetery"; visualCategoryNames[GeoDataFeature::LanduseCommercial] = "LanduseCommercial"; visualCategoryNames[GeoDataFeature::LanduseConstruction] = "LanduseConstruction"; visualCategoryNames[GeoDataFeature::LanduseFarmland] = "LanduseFarmland"; visualCategoryNames[GeoDataFeature::LanduseFarmyard] = "LanduseFarmyard"; visualCategoryNames[GeoDataFeature::LanduseGarages] = "LanduseGarages"; visualCategoryNames[GeoDataFeature::LanduseGrass] = "LanduseGrass"; visualCategoryNames[GeoDataFeature::LanduseIndustrial] = "LanduseIndustrial"; visualCategoryNames[GeoDataFeature::LanduseLandfill] = "LanduseLandfill"; visualCategoryNames[GeoDataFeature::LanduseMeadow] = "LanduseMeadow"; visualCategoryNames[GeoDataFeature::LanduseMilitary] = "LanduseMilitary"; visualCategoryNames[GeoDataFeature::LanduseQuarry] = "LanduseQuarry"; visualCategoryNames[GeoDataFeature::LanduseRailway] = "LanduseRailway"; visualCategoryNames[GeoDataFeature::LanduseReservoir] = "LanduseReservoir"; visualCategoryNames[GeoDataFeature::LanduseResidential] = "LanduseResidential"; visualCategoryNames[GeoDataFeature::LanduseRetail] = "LanduseRetail"; visualCategoryNames[GeoDataFeature::LanduseOrchard] = "LanduseOrchard"; visualCategoryNames[GeoDataFeature::LanduseVineyard] = "LanduseVineyard"; visualCategoryNames[GeoDataFeature::RailwayRail] = "RailwayRail"; visualCategoryNames[GeoDataFeature::RailwayNarrowGauge] = "RailwayNarrowGauge"; visualCategoryNames[GeoDataFeature::RailwayTram] = "RailwayTram"; visualCategoryNames[GeoDataFeature::RailwayLightRail] = "RailwayLightRail"; visualCategoryNames[GeoDataFeature::RailwayAbandoned] = "RailwayAbandoned"; visualCategoryNames[GeoDataFeature::RailwaySubway] = "RailwaySubway"; visualCategoryNames[GeoDataFeature::RailwayPreserved] = "RailwayPreserved"; visualCategoryNames[GeoDataFeature::RailwayMiniature] = "RailwayMiniature"; visualCategoryNames[GeoDataFeature::RailwayConstruction] = "RailwayConstruction"; visualCategoryNames[GeoDataFeature::RailwayMonorail] = "RailwayMonorail"; visualCategoryNames[GeoDataFeature::RailwayFunicular] = "RailwayFunicular"; visualCategoryNames[GeoDataFeature::PowerTower] = "PowerTower"; visualCategoryNames[GeoDataFeature::Satellite] = "Satellite"; visualCategoryNames[GeoDataFeature::Landmass] = "Landmass"; visualCategoryNames[GeoDataFeature::UrbanArea] = "UrbanArea"; visualCategoryNames[GeoDataFeature::InternationalDateLine] = "InternationalDateLine"; visualCategoryNames[GeoDataFeature::Bathymetry] = "Bathymetry"; visualCategoryNames[GeoDataFeature::AdminLevel1] = "AdminLevel1"; visualCategoryNames[GeoDataFeature::AdminLevel2] = "AdminLevel2"; visualCategoryNames[GeoDataFeature::AdminLevel3] = "AdminLevel3"; visualCategoryNames[GeoDataFeature::AdminLevel4] = "AdminLevel4"; visualCategoryNames[GeoDataFeature::AdminLevel5] = "AdminLevel5"; visualCategoryNames[GeoDataFeature::AdminLevel6] = "AdminLevel6"; visualCategoryNames[GeoDataFeature::AdminLevel7] = "AdminLevel7"; visualCategoryNames[GeoDataFeature::AdminLevel8] = "AdminLevel8"; visualCategoryNames[GeoDataFeature::AdminLevel9] = "AdminLevel9"; visualCategoryNames[GeoDataFeature::AdminLevel10] = "AdminLevel10"; visualCategoryNames[GeoDataFeature::AdminLevel11] = "AdminLevel11"; visualCategoryNames[GeoDataFeature::BoundaryMaritime] = "BoundaryMaritime"; visualCategoryNames[GeoDataFeature::LastIndex] = "LastIndex"; } Q_ASSERT(visualCategoryNames.contains(category)); return visualCategoryNames[category]; } StyleParameters::StyleParameters(const GeoDataFeature *feature_, int tileLevel_) : feature(feature_), tileLevel(tileLevel_) { // nothing to do } } diff --git a/src/lib/marble/geodata/data/GeoDataFeature.h b/src/lib/marble/geodata/data/GeoDataFeature.h index f6e0eebb4..af988b99b 100644 --- a/src/lib/marble/geodata/data/GeoDataFeature.h +++ b/src/lib/marble/geodata/data/GeoDataFeature.h @@ -1,658 +1,659 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2007 Murad Tagirov // Copyright 2009 Patrick Spendrin // #ifndef MARBLE_GEODATAFEATURE_H #define MARBLE_GEODATAFEATURE_H #include "GeoDataObject.h" #include "geodata_export.h" namespace Marble { // forward define all features we can find. class GeoDataRegion; class GeoDataAbstractView; class GeoDataStyle; class GeoDataStyleMap; class GeoDataExtendedData; class GeoDataTimeSpan; class GeoDataTimeStamp; class GeoDataFeaturePrivate; class GeoDataSnippet; /** * @short A base class for all geodata features * * GeoDataFeature is the base class for most geodata classes that * correspond to places on a map. It is never instantiated by itself, * but is always used as part of a derived class. * * @see GeoDataPlacemark * @see GeoDataContainer */ // FIXME: Later also add NetworkLink and Overlay class GEODATA_EXPORT GeoDataFeature : public GeoDataObject { public: GeoDataFeature(); /// Create a new GeoDataFeature with @p name as its name. explicit GeoDataFeature( const QString& name ); GeoDataFeature( const GeoDataFeature& other ); virtual ~GeoDataFeature(); GeoDataFeature& operator=( const GeoDataFeature& other ); /// Provides type information for downcasting a GeoData virtual const char* nodeType() const; EnumFeatureId featureId() const; /** * @brief A categorization of a placemark as defined by ...FIXME. * There is an additional osm tag mapping to GeoDataVisualCategory * in OsmPresetLibrary.cpp */ enum GeoDataVisualCategory { None, Default, Unknown, // The order of the cities needs to stay fixed as the // algorithms rely on that. SmallCity, SmallCountyCapital, SmallStateCapital, SmallNationCapital, MediumCity, MediumCountyCapital, MediumStateCapital, MediumNationCapital, BigCity, BigCountyCapital, BigStateCapital, BigNationCapital, LargeCity, LargeCountyCapital, LargeStateCapital, LargeNationCapital, Nation, PlaceCity, PlaceSuburb, PlaceHamlet, PlaceLocality, PlaceTown, PlaceVillage, // Terrain Mountain, Volcano, Mons, // m Valley, // v Continent, Ocean, OtherTerrain, // o // Space Terrain Crater, // c Mare, // a // Places of Interest GeographicPole, MagneticPole, ShipWreck, AirPort, Observatory, // Military MilitaryDangerArea, // Runners OsmSite, Coordinate, // Planets MannedLandingSite, // h RoboticRover, // r UnmannedSoftLandingSite, // u UnmannedHardLandingSite, // i Folder, Bookmark, NaturalWater, NaturalReef, NaturalWood, NaturalBeach, NaturalWetland, NaturalGlacier, NaturalIceShelf, NaturalScrub, NaturalCliff, NaturalHeath, HighwayTrafficSignals, // OpenStreetMap highways HighwaySteps, HighwayUnknown, HighwayPath, HighwayFootway, HighwayTrack, HighwayPedestrian, HighwayCycleway, HighwayService, HighwayRoad, HighwayResidential, HighwayLivingStreet, HighwayUnclassified, HighwayTertiaryLink, HighwayTertiary, HighwaySecondaryLink, HighwaySecondary, HighwayPrimaryLink, HighwayPrimary, HighwayTrunkLink, HighwayTrunk, HighwayMotorwayLink, HighwayMotorway, //OSM building Building, // OpenStreetMap category Accomodation AccomodationCamping, AccomodationHostel, AccomodationHotel, AccomodationMotel, AccomodationYouthHostel, AccomodationGuestHouse, // OpenStreetMap category Amenity AmenityLibrary, AmenityKindergarten, // OpenStreetMap category Education EducationCollege, EducationSchool, EducationUniversity, // OpenStreetMap category Food FoodBar, FoodBiergarten, FoodCafe, FoodFastFood, FoodPub, FoodRestaurant, // OpenStreetMap category Health HealthDentist, HealthDoctors, HealthHospital, HealthPharmacy, HealthVeterinary, // OpenStreetMap category Money MoneyAtm, MoneyBank, AmenityArchaeologicalSite, AmenityEmbassy, AmenityEmergencyPhone, AmenityWaterPark, AmenityCommunityCentre, AmenityFountain, AmenityNightClub, AmenityBench, AmenityCourtHouse, AmenityFireStation, AmenityHuntingStand, AmenityPolice, AmenityPostBox, AmenityPostOffice, AmenityPrison, AmenityRecycling, AmenityShelter, AmenityTelephone, AmenityToilets, AmenityTownHall, AmenityWasteBasket, AmenityDrinkingWater, AmenityGraveyard, // OpenStreetMap category Barrier BarrierCityWall, BarrierGate, BarrierLiftGate, BarrierWall, NaturalPeak, NaturalTree, // OpenStreetMap category Shopping ShopBeverages, ShopHifi, ShopSupermarket, ShopAlcohol, ShopBakery, ShopButcher, ShopConfectionery, ShopConvenience, ShopGreengrocer, ShopSeafood, ShopDepartmentStore, ShopKiosk, ShopBag, ShopClothes, ShopFashion, ShopJewelry, ShopShoes, ShopVarietyStore, ShopBeauty, ShopChemist, ShopCosmetics, ShopHairdresser, ShopOptician, ShopPerfumery, ShopDoitYourself, ShopFlorist, ShopHardware, ShopFurniture, ShopElectronics, ShopMobilePhone, ShopBicycle, ShopCar, ShopCarRepair, ShopCarParts, ShopMotorcycle, ShopOutdoor, ShopMusicalInstrument, ShopPhoto, ShopBook, ShopGift, ShopStationery, ShopLaundry, ShopPet, ShopToys, ShopTravelAgency, Shop, ManmadeBridge, ManmadeLighthouse, ManmadePier, ManmadeWaterTower, ManmadeWindMill, // OpenStreetMap category Tourist TouristAttraction, TouristCastle, TouristCinema, TouristInformation, TouristMonument, TouristMuseum, TouristRuin, TouristTheatre, TouristThemePark, TouristViewPoint, TouristZoo, TouristAlpineHut, // OpenStreetMap category Transport TransportAerodrome, TransportHelipad, TransportAirportTerminal, TransportAirportGate, TransportAirportRunway, + TransportAirportTaxiway, TransportBusStation, TransportBusStop, TransportCarShare, TransportFuel, TransportParking, TransportParkingSpace, TransportPlatform, TransportRentalBicycle, TransportRentalCar, TransportTaxiRank, TransportTrainStation, TransportTramStop, TransportBicycleParking, TransportMotorcycleParking, TransportSubwayEntrance, // OpenStreetMap category religion ReligionPlaceOfWorship, ReligionBahai, ReligionBuddhist, ReligionChristian, ReligionMuslim, ReligionHindu, ReligionJain, ReligionJewish, ReligionShinto, ReligionSikh, // OpenStreetMap category Leisure LeisureGolfCourse, LeisureMarina, LeisurePark, LeisurePlayground, LeisurePitch, LeisureSportsCentre, LeisureStadium, LeisureTrack, LeisureSwimmingPool, LanduseAllotments, LanduseBasin, LanduseCemetery, LanduseCommercial, LanduseConstruction, LanduseFarmland, LanduseFarmyard, LanduseGarages, LanduseGrass, LanduseIndustrial, LanduseLandfill, LanduseMeadow, LanduseMilitary, LanduseQuarry, LanduseRailway, LanduseReservoir, LanduseResidential, LanduseRetail, LanduseOrchard, LanduseVineyard, RailwayRail, RailwayNarrowGauge, RailwayTram, RailwayLightRail, RailwayAbandoned, RailwaySubway, RailwayPreserved, RailwayMiniature, RailwayConstruction, RailwayMonorail, RailwayFunicular, // OpenStreetMap category Power PowerTower, Satellite, //Admin level tags for depicting boundary AdminLevel1, AdminLevel2, AdminLevel3, AdminLevel4, AdminLevel5, AdminLevel6, AdminLevel7, AdminLevel8, AdminLevel9, AdminLevel10, AdminLevel11, BoundaryMaritime, //Custom OSM Tags Landmass, UrbanArea, InternationalDateLine, Bathymetry, // Important: Make sure that this is always the last // item and just use it to specify the array size LastIndex }; /** * @brief The name of the feature * * The name of the feature should be a short string. It is often * shown directly on the map and need therefore not take up much * space. * * @return The name of this feature */ QString name() const; /** * @brief Set a new name for this feature * @param value the new name */ void setName( const QString &value ); /** * @brief A short description of the feature. * * HTML markup is not supported. * @TODO When the Snippet is not supplied, the first lines of description should be used. * @return The name of this feature */ GeoDataSnippet snippet() const; /** * @brief Set a new name for this feature * @param value the new name */ void setSnippet( const GeoDataSnippet &value ); /// Return the address of the feature QString address() const; /// Set the address of this feature to @p value. void setAddress( const QString &value); /// Return the phone number of the feature QString phoneNumber() const; /// Set the phone number of this feature to @p value. void setPhoneNumber( const QString &value ); /// Return the text description of the feature. QString description() const; /// Set the description of this feature to @p value. void setDescription( const QString &value ); /** * @brief test if the description is CDATA or not * CDATA allows for special characters to be included in XML and also allows * for other XML formats to be embedded in the XML without interfering with * parser namespace. * @return @true if the description should be treated as CDATA * @false if the description is a plain string */ bool descriptionIsCDATA() const; /// Set the description to be CDATA See: @see descriptionIsCDATA() void setDescriptionCDATA( bool cdata ); /// Get the Abstract view of the feature const GeoDataAbstractView *abstractView() const; GeoDataAbstractView *abstractView(); /// Set the abstract view of the feature void setAbstractView( GeoDataAbstractView *abstractView ); /// Return the styleUrl of the feature. QString styleUrl() const; /// Set the styleUrl of this feature to @p value. void setStyleUrl( const QString &value ); /// Return whether this feature is visible or not bool isVisible() const; /// Return whether this feature is visible or not in the context of its parenting bool isGloballyVisible() const; /** * @brief Set a new value for visibility * @param value new value for the visibility * * This function sets the visibility, i.e. whether this feature * should be shown or not. This can be changed either from a GUI * or through some action of the program. */ void setVisible( bool value ); /** * Return the timespan of the feature. */ const GeoDataTimeSpan& timeSpan() const; GeoDataTimeSpan& timeSpan(); /** * Set the timespan of the feature. * @param timeSpan new of timespan. */ void setTimeSpan( const GeoDataTimeSpan &timeSpan ); /** * Return the timestamp of the feature. */ const GeoDataTimeStamp& timeStamp() const; GeoDataTimeStamp& timeStamp(); /** * Set the timestamp of the feature. * @param timeStamp new of the timestamp. */ void setTimeStamp( const GeoDataTimeStamp &timeStamp ); /** * Return the style assigned to the placemark, or a default style if none has been set */ QSharedPointer style() const; /** * Return the style assigned to the placemark with setStyle (can be 0) */ QSharedPointer customStyle() const; /** * Sets the style of the placemark. * @param style the new style to be used. */ void setStyle( const QSharedPointer &style ); /** * Return the ExtendedData assigned to the feature. */ GeoDataExtendedData& extendedData(); const GeoDataExtendedData& extendedData() const; /** * Sets the ExtendedData of the feature. * @param extendedData the new ExtendedData to be used. */ void setExtendedData( const GeoDataExtendedData& extendedData ); /** * Return the region assigned to the placemark. */ GeoDataRegion& region() const; /** * @brief Sets the region of the placemark. * @param region new value for the region * * The feature is only shown when the region if active. */ void setRegion( const GeoDataRegion& region ); /** * Return the symbol index of the placemark. */ GeoDataVisualCategory visualCategory() const; /** * Sets the symbol @p index of the placemark. * @param category the new category to be used. */ void setVisualCategory( GeoDataVisualCategory category ); /** * Return the role of the placemark. * * FIXME: describe roles here! */ const QString role() const; /** * Sets the role of the placemark. * @param role the new role to be used. */ void setRole( const QString &role ); /** * @brief Return the popularity index of the placemark. * * The popularity index is a value which describes at which zoom * level the placemark will be shown. */ int zoomLevel() const; /** * Sets the popularity @p index of the placemark. * @param index the new index to be used. */ void setZoomLevel( int index ); /** * Return the popularity of the feature. */ qint64 popularity() const; /** * Sets the @p popularity of the feature. * @param popularity the new popularity value */ void setPopularity( qint64 popularity ); /** * Return a pointer to a GeoDataStyleMap object which represents the styleMap * of this feature. A styleMap is simply a QMap which can connect * two styles with a keyword. This can be used to have a highlighted and a * normal style. * @see GeoDataStyleMap */ const GeoDataStyleMap* styleMap() const; /** * Sets the styleMap of the feature */ void setStyleMap( const GeoDataStyleMap* map ); QString categoryName() const; /// Serialize the contents of the feature to @p stream. virtual void pack( QDataStream& stream ) const; /// Unserialize the contents of the feature from @p stream. virtual void unpack( QDataStream& stream ); protected: // the d-pointer needs to be protected to be accessible from derived classes GeoDataFeaturePrivate* d; explicit GeoDataFeature( GeoDataFeaturePrivate* priv ); virtual void detach(); bool equals( const GeoDataFeature &other ) const; using GeoDataObject::equals; private: // the private d pointer accessor - use it instead of the d pointer directly GeoDataFeaturePrivate* p() const; }; } #endif diff --git a/src/lib/marble/geodata/data/GeoDataFeature_p.h b/src/lib/marble/geodata/data/GeoDataFeature_p.h index be9f4355a..b94213fa8 100644 --- a/src/lib/marble/geodata/data/GeoDataFeature_p.h +++ b/src/lib/marble/geodata/data/GeoDataFeature_p.h @@ -1,461 +1,462 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2009 Patrick Spendrin // #ifndef MARBLE_GEODATAFEATUREPRIVATE_H #define MARBLE_GEODATAFEATUREPRIVATE_H #include #include #include "GeoDataExtendedData.h" #include "GeoDataAbstractView.h" #include "GeoDataFeature.h" #include "GeoDataRegion.h" #include "GeoDataTimeStamp.h" #include "GeoDataTimeSpan.h" #include "GeoDataTypes.h" #include "GeoDataStyle.h" #include "GeoDataSnippet.h" #include "MarbleDirs.h" namespace Marble { class GeoDataFeaturePrivate { Q_DECLARE_TR_FUNCTIONS(GeoDataFeature) public: GeoDataFeaturePrivate() : m_name(), m_snippet(), m_description(), m_descriptionCDATA(), m_address(), m_phoneNumber(), m_styleUrl(), m_abstractView( 0 ), m_popularity( 0 ), m_zoomLevel( 1 ), m_visible( true ), m_visualCategory( GeoDataFeature::Default ), m_role(" "), m_style( 0 ), m_styleMap( 0 ), m_extendedData(), m_timeSpan(), m_timeStamp(), m_region(), ref( 0 ) { } GeoDataFeaturePrivate( const GeoDataFeaturePrivate& other ) : m_name( other.m_name ), m_snippet( other.m_snippet ), m_description( other.m_description ), m_descriptionCDATA( other.m_descriptionCDATA), m_address( other.m_address ), m_phoneNumber( other.m_phoneNumber ), m_styleUrl( other.m_styleUrl ), m_abstractView( other.m_abstractView ), m_popularity( other.m_popularity ), m_zoomLevel( other.m_zoomLevel ), m_visible( other.m_visible ), m_visualCategory( other.m_visualCategory ), m_role( other.m_role ), m_style( other.m_style ), //FIXME: both style and stylemap need to be reworked internally!!!! m_styleMap( other.m_styleMap ), m_extendedData( other.m_extendedData ), m_timeSpan( other.m_timeSpan ), m_timeStamp( other.m_timeStamp ), m_region( other.m_region ), ref( 0 ) { } GeoDataFeaturePrivate& operator=( const GeoDataFeaturePrivate& other ) { m_name = other.m_name; m_snippet = other.m_snippet; m_description = other.m_description; m_descriptionCDATA = other.m_descriptionCDATA; m_address = other.m_address; m_phoneNumber = other.m_phoneNumber; m_styleUrl = other.m_styleUrl; m_abstractView = other.m_abstractView; m_popularity = other.m_popularity; m_zoomLevel = other.m_zoomLevel; m_visible = other.m_visible; m_role = other.m_role; m_style = other.m_style; m_styleMap = other.m_styleMap; m_timeSpan = other.m_timeSpan; m_timeStamp = other.m_timeStamp; m_visualCategory = other.m_visualCategory; m_extendedData = other.m_extendedData; m_region = other.m_region; return *this; } virtual GeoDataFeaturePrivate* copy() { GeoDataFeaturePrivate* copy = new GeoDataFeaturePrivate; *copy = *this; return copy; } virtual EnumFeatureId featureId() const { return InvalidFeatureId; } virtual ~GeoDataFeaturePrivate() { } virtual const char* nodeType() const { return GeoDataTypes::GeoDataFeatureType; } QString categoryName() const { switch (m_visualCategory) { case GeoDataFeature::SmallCity: return tr("City"); case GeoDataFeature::SmallCountyCapital: return tr("County Capital"); case GeoDataFeature::SmallStateCapital: return tr("State Capital"); case GeoDataFeature::SmallNationCapital: return tr("Nation Capital"); case GeoDataFeature::MediumCity: return tr("City"); case GeoDataFeature::MediumCountyCapital: return tr("County Capital"); case GeoDataFeature::MediumStateCapital: return tr("State Capital"); case GeoDataFeature::MediumNationCapital: return tr("Nation Capital"); case GeoDataFeature::BigCity: return tr("City"); case GeoDataFeature::BigCountyCapital: return tr("County Capital"); case GeoDataFeature::BigStateCapital: return tr("State Capital"); case GeoDataFeature::BigNationCapital: return tr("Nation Capital"); case GeoDataFeature::LargeCity: return tr("City"); case GeoDataFeature::LargeCountyCapital: return tr("County Capital"); case GeoDataFeature::LargeStateCapital: return tr("State Capital"); case GeoDataFeature::LargeNationCapital: return tr("Nation Capital"); case GeoDataFeature::Nation: return tr("Nation"); case GeoDataFeature::PlaceCity: return tr("City"); case GeoDataFeature::PlaceSuburb: return tr("Suburb"); case GeoDataFeature::PlaceHamlet: return tr("Hamlet"); case GeoDataFeature::PlaceLocality: return tr("Locality"); case GeoDataFeature::PlaceTown: return tr("Town"); case GeoDataFeature::PlaceVillage: return tr("Village"); case GeoDataFeature::Mountain: return tr("Mountain"); case GeoDataFeature::Volcano: return tr("Volcano"); case GeoDataFeature::Continent: return tr("Continent"); case GeoDataFeature::Ocean: return tr("Ocean"); case GeoDataFeature::GeographicPole: return tr("Geographic Pole"); case GeoDataFeature::MagneticPole: return tr("Magnetic Pole"); case GeoDataFeature::ShipWreck: return tr("Ship Wreck"); case GeoDataFeature::AirPort: return tr("Air Port"); case GeoDataFeature::Observatory: return tr("Observatory"); case GeoDataFeature::MilitaryDangerArea: return tr("Military Danger Area"); case GeoDataFeature::OsmSite: return tr("OSM Site"); case GeoDataFeature::Coordinate: return tr("Coordinate"); case GeoDataFeature::Folder: return tr("Folder"); case GeoDataFeature::Bookmark: return tr("Bookmark"); case GeoDataFeature::NaturalWater: return tr("Water"); case GeoDataFeature::NaturalReef: return tr("Reef"); case GeoDataFeature::NaturalWood: return tr("Wood"); case GeoDataFeature::NaturalBeach: return tr("Beach"); case GeoDataFeature::NaturalWetland: return tr("Wetland"); case GeoDataFeature::NaturalGlacier: return tr("Glacier"); case GeoDataFeature::NaturalIceShelf: return tr("Ice Shelf"); case GeoDataFeature::NaturalScrub: return tr("Scrub"); case GeoDataFeature::NaturalCliff: return tr("Cliff"); case GeoDataFeature::NaturalHeath: return tr("Heath"); case GeoDataFeature::HighwayTrafficSignals: return tr("Traffic Signals"); case GeoDataFeature::HighwaySteps: return tr("Steps"); case GeoDataFeature::HighwayUnknown: return tr("Unknown Road"); case GeoDataFeature::HighwayPath: return tr("Path"); case GeoDataFeature::HighwayFootway: return tr("Footway"); case GeoDataFeature::HighwayTrack: return tr("Track"); case GeoDataFeature::HighwayPedestrian: return tr("Footway"); case GeoDataFeature::HighwayCycleway: return tr("Cycleway"); case GeoDataFeature::HighwayService: return tr("Service Road"); case GeoDataFeature::HighwayRoad: return tr("Road"); case GeoDataFeature::HighwayResidential: return tr("Residential Road"); case GeoDataFeature::HighwayLivingStreet: return tr("Living Street"); case GeoDataFeature::HighwayUnclassified: return tr("Unclassified Road"); case GeoDataFeature::HighwayTertiaryLink: return tr("Tertiary Link Road"); case GeoDataFeature::HighwayTertiary: return tr("Tertiary Road"); case GeoDataFeature::HighwaySecondaryLink: return tr("Secondary Link Road"); case GeoDataFeature::HighwaySecondary: return tr("Secondary Road"); case GeoDataFeature::HighwayPrimaryLink: return tr("Primary Link Road"); case GeoDataFeature::HighwayPrimary: return tr("Primary Road"); case GeoDataFeature::HighwayTrunkLink: return tr("Trunk Link Road"); case GeoDataFeature::HighwayTrunk: return tr("Trunk Road"); case GeoDataFeature::HighwayMotorwayLink: return tr("Motorway Link Road"); case GeoDataFeature::HighwayMotorway: return tr("Motorway"); case GeoDataFeature::Building: return tr("Building"); case GeoDataFeature::AccomodationCamping: return tr("Camping"); case GeoDataFeature::AccomodationHostel: return tr("Hostel"); case GeoDataFeature::AccomodationHotel: return tr("Hotel"); case GeoDataFeature::AccomodationMotel: return tr("Motel"); case GeoDataFeature::AccomodationYouthHostel: return tr("Youth Hostel"); case GeoDataFeature::AccomodationGuestHouse: return tr("Guest House"); case GeoDataFeature::AmenityLibrary: return tr("Library"); case GeoDataFeature::AmenityKindergarten: return tr("Kindergarten"); case GeoDataFeature::EducationCollege: return tr("College"); case GeoDataFeature::EducationSchool: return tr("School"); case GeoDataFeature::EducationUniversity: return tr("University"); case GeoDataFeature::FoodBar: return tr("Bar"); case GeoDataFeature::FoodBiergarten: return tr("Biergarten"); case GeoDataFeature::FoodCafe: return tr("Cafe"); case GeoDataFeature::FoodFastFood: return tr("Fast Food"); case GeoDataFeature::FoodPub: return tr("Pub"); case GeoDataFeature::FoodRestaurant: return tr("Restaurant"); case GeoDataFeature::HealthDentist: return tr("Dentist"); case GeoDataFeature::HealthDoctors: return tr("Doctors"); case GeoDataFeature::HealthHospital: return tr("Hospital"); case GeoDataFeature::HealthPharmacy: return tr("Pharmacy"); case GeoDataFeature::HealthVeterinary: return tr("Veterinary"); case GeoDataFeature::MoneyAtm: return tr("ATM"); case GeoDataFeature::MoneyBank: return tr("Bank"); case GeoDataFeature::AmenityArchaeologicalSite: return tr("Archaeological Site"); case GeoDataFeature::AmenityEmbassy: return tr("Embassy"); case GeoDataFeature::AmenityEmergencyPhone: return tr("Emergency Phone"); case GeoDataFeature::AmenityWaterPark: return tr("Water Park"); case GeoDataFeature::AmenityCommunityCentre: return tr("Community Centre"); case GeoDataFeature::AmenityFountain: return tr("Fountain"); case GeoDataFeature::AmenityNightClub: return tr("Night Club"); case GeoDataFeature::AmenityBench: return tr("Bench"); case GeoDataFeature::AmenityCourtHouse: return tr("Court House"); case GeoDataFeature::AmenityFireStation: return tr("Fire Station"); case GeoDataFeature::AmenityHuntingStand: return tr("Hunting Stand"); case GeoDataFeature::AmenityPolice: return tr("Police"); case GeoDataFeature::AmenityPostBox: return tr("Post Box"); case GeoDataFeature::AmenityPostOffice: return tr("Post Office"); case GeoDataFeature::AmenityPrison: return tr("Prison"); case GeoDataFeature::AmenityRecycling: return tr("Recycling"); case GeoDataFeature::AmenityShelter: return tr("Shelter"); case GeoDataFeature::AmenityTelephone: return tr("Telephone"); case GeoDataFeature::AmenityToilets: return tr("Toilets"); case GeoDataFeature::AmenityTownHall: return tr("Town Hall"); case GeoDataFeature::AmenityWasteBasket: return tr("Waste Basket"); case GeoDataFeature::AmenityDrinkingWater: return tr("Drinking Water"); case GeoDataFeature::AmenityGraveyard: return tr("Graveyard"); case GeoDataFeature::BarrierCityWall: return tr("City Wall"); case GeoDataFeature::BarrierGate: return tr("Gate"); case GeoDataFeature::BarrierLiftGate: return tr("Lift Gate"); case GeoDataFeature::BarrierWall: return tr("Wall"); case GeoDataFeature::NaturalPeak: return tr("Peak"); case GeoDataFeature::NaturalTree: return tr("Tree"); case GeoDataFeature::ShopBeverages: return tr("Beverages"); case GeoDataFeature::ShopHifi: return tr("Hifi"); case GeoDataFeature::ShopSupermarket: return tr("Supermarket"); case GeoDataFeature::ShopAlcohol: return tr("Alcohol"); case GeoDataFeature::ShopBakery: return tr("Bakery"); case GeoDataFeature::ShopButcher: return tr("Butcher"); case GeoDataFeature::ShopConfectionery: return tr("Confectionery"); case GeoDataFeature::ShopConvenience: return tr("Convenience Shop"); case GeoDataFeature::ShopGreengrocer: return tr("Greengrocer"); case GeoDataFeature::ShopSeafood: return tr("Seafood"); case GeoDataFeature::ShopDepartmentStore: return tr("Department Store"); case GeoDataFeature::ShopKiosk: return tr("Kiosk"); case GeoDataFeature::ShopBag: return tr("Bag"); case GeoDataFeature::ShopClothes: return tr("Clothes"); case GeoDataFeature::ShopFashion: return tr("Fashion"); case GeoDataFeature::ShopJewelry: return tr("Jewelry"); case GeoDataFeature::ShopShoes: return tr("Shoes"); case GeoDataFeature::ShopVarietyStore: return tr("Variety Store"); case GeoDataFeature::ShopBeauty: return tr("Beauty"); case GeoDataFeature::ShopChemist: return tr("Chemist"); case GeoDataFeature::ShopCosmetics: return tr("Cosmetics"); case GeoDataFeature::ShopHairdresser: return tr("Hairdresser"); case GeoDataFeature::ShopOptician: return tr("Optician"); case GeoDataFeature::ShopPerfumery: return tr("Perfumery"); case GeoDataFeature::ShopDoitYourself: return tr("Doit Yourself"); case GeoDataFeature::ShopFlorist: return tr("Florist"); case GeoDataFeature::ShopHardware: return tr("Hardware"); case GeoDataFeature::ShopFurniture: return tr("Furniture"); case GeoDataFeature::ShopElectronics: return tr("Electronics"); case GeoDataFeature::ShopMobilePhone: return tr("Mobile Phone"); case GeoDataFeature::ShopBicycle: return tr("Bicycle"); case GeoDataFeature::ShopCar: return tr("Car"); case GeoDataFeature::ShopCarRepair: return tr("Car Repair"); case GeoDataFeature::ShopCarParts: return tr("Car Parts"); case GeoDataFeature::ShopMotorcycle: return tr("Motorcycle"); case GeoDataFeature::ShopOutdoor: return tr("Outdoor"); case GeoDataFeature::ShopMusicalInstrument: return tr("Musical Instrument"); case GeoDataFeature::ShopPhoto: return tr("Photo"); case GeoDataFeature::ShopBook: return tr("Book"); case GeoDataFeature::ShopGift: return tr("Gift"); case GeoDataFeature::ShopStationery: return tr("Stationery"); case GeoDataFeature::ShopLaundry: return tr("Laundry"); case GeoDataFeature::ShopPet: return tr("Pet"); case GeoDataFeature::ShopToys: return tr("Toys"); case GeoDataFeature::ShopTravelAgency: return tr("Travel Agency"); case GeoDataFeature::Shop: return tr("Shop"); case GeoDataFeature::ManmadeBridge: return tr("Bridge"); case GeoDataFeature::ManmadeLighthouse: return tr("Lighthouse"); case GeoDataFeature::ManmadePier: return tr("Pier"); case GeoDataFeature::ManmadeWaterTower: return tr("Water Tower"); case GeoDataFeature::ManmadeWindMill: return tr("Wind Mill"); case GeoDataFeature::TouristAttraction: return tr("Tourist Attraction"); case GeoDataFeature::TouristCastle: return tr("Castle"); case GeoDataFeature::TouristCinema: return tr("Cinema"); case GeoDataFeature::TouristInformation: return tr("Information"); case GeoDataFeature::TouristMonument: return tr("Monument"); case GeoDataFeature::TouristMuseum: return tr("Museum"); case GeoDataFeature::TouristRuin: return tr("Ruin"); case GeoDataFeature::TouristTheatre: return tr("Theatre"); case GeoDataFeature::TouristThemePark: return tr("Theme Park"); case GeoDataFeature::TouristViewPoint: return tr("View Point"); case GeoDataFeature::TouristZoo: return tr("Zoo"); case GeoDataFeature::TouristAlpineHut: return tr("Alpine Hut"); case GeoDataFeature::TransportAerodrome: return tr("Aerodrome"); case GeoDataFeature::TransportHelipad: return tr("Helipad"); case GeoDataFeature::TransportAirportGate: return tr("Airport Gate"); case GeoDataFeature::TransportAirportRunway: return tr("Airport Runway"); + case GeoDataFeature::TransportAirportTaxiway: return tr("Airport Taxiway"); case GeoDataFeature::TransportAirportTerminal: return tr("Airport Terminal"); case GeoDataFeature::TransportBusStation: return tr("Bus Station"); case GeoDataFeature::TransportBusStop: return tr("Bus Stop"); case GeoDataFeature::TransportCarShare: return tr("Car Sharing"); case GeoDataFeature::TransportFuel: return tr("Gas Station"); case GeoDataFeature::TransportParking: return tr("Parking"); case GeoDataFeature::TransportParkingSpace: return tr("Parking Space"); case GeoDataFeature::TransportPlatform: return tr("Platform"); case GeoDataFeature::TransportRentalBicycle: return tr("Rental Bicycle"); case GeoDataFeature::TransportRentalCar: return tr("Rental Car"); case GeoDataFeature::TransportTaxiRank: return tr("Taxi Rank"); case GeoDataFeature::TransportTrainStation: return tr("Train Station"); case GeoDataFeature::TransportTramStop: return tr("Tram Stop"); case GeoDataFeature::TransportBicycleParking: return tr("Bicycle Parking"); case GeoDataFeature::TransportMotorcycleParking: return tr("Motorcycle Parking"); case GeoDataFeature::TransportSubwayEntrance: return tr("Subway Entrance"); case GeoDataFeature::ReligionPlaceOfWorship: return tr("Place Of Worship"); case GeoDataFeature::ReligionBahai: return tr("Bahai"); case GeoDataFeature::ReligionBuddhist: return tr("Buddhist"); case GeoDataFeature::ReligionChristian: return tr("Christian"); case GeoDataFeature::ReligionMuslim: return tr("Muslim"); case GeoDataFeature::ReligionHindu: return tr("Hindu"); case GeoDataFeature::ReligionJain: return tr("Jain"); case GeoDataFeature::ReligionJewish: return tr("Jewish"); case GeoDataFeature::ReligionShinto: return tr("Shinto"); case GeoDataFeature::ReligionSikh: return tr("Sikh"); case GeoDataFeature::LeisureGolfCourse: return tr("Golf Course"); case GeoDataFeature::LeisureMarina: return tr("Marina"); case GeoDataFeature::LeisurePark: return tr("Park"); case GeoDataFeature::LeisurePlayground: return tr("Playground"); case GeoDataFeature::LeisurePitch: return tr("Pitch"); case GeoDataFeature::LeisureSportsCentre: return tr("Sports Centre"); case GeoDataFeature::LeisureStadium: return tr("Stadium"); case GeoDataFeature::LeisureTrack: return tr("Track"); case GeoDataFeature::LeisureSwimmingPool: return tr("Swimming Pool"); case GeoDataFeature::LanduseAllotments: return tr("Allotments"); case GeoDataFeature::LanduseBasin: return tr("Basin"); case GeoDataFeature::LanduseCemetery: return tr("Cemetery"); case GeoDataFeature::LanduseCommercial: return tr("Commercial"); case GeoDataFeature::LanduseConstruction: return tr("Construction"); case GeoDataFeature::LanduseFarmland: return tr("Farmland"); case GeoDataFeature::LanduseFarmyard: return tr("Farmyard"); case GeoDataFeature::LanduseGarages: return tr("Garages"); case GeoDataFeature::LanduseGrass: return tr("Grass"); case GeoDataFeature::LanduseIndustrial: return tr("Industrial"); case GeoDataFeature::LanduseLandfill: return tr("Landfill"); case GeoDataFeature::LanduseMeadow: return tr("Meadow"); case GeoDataFeature::LanduseMilitary: return tr("Military"); case GeoDataFeature::LanduseQuarry: return tr("Quarry"); case GeoDataFeature::LanduseRailway: return tr("Railway"); case GeoDataFeature::LanduseReservoir: return tr("Reservoir"); case GeoDataFeature::LanduseResidential: return tr("Residential"); case GeoDataFeature::LanduseRetail: return tr("Retail"); case GeoDataFeature::LanduseOrchard: return tr("Orchard"); case GeoDataFeature::LanduseVineyard: return tr("Vineyard"); case GeoDataFeature::RailwayRail: return tr("Rail"); case GeoDataFeature::RailwayNarrowGauge: return tr("Narrow Gauge"); case GeoDataFeature::RailwayTram: return tr("Tram"); case GeoDataFeature::RailwayLightRail: return tr("Light Rail"); case GeoDataFeature::RailwayAbandoned: return tr("Abandoned Railway"); case GeoDataFeature::RailwaySubway: return tr("Subway"); case GeoDataFeature::RailwayPreserved: return tr("Preserved Railway"); case GeoDataFeature::RailwayMiniature: return tr("Miniature Railway"); case GeoDataFeature::RailwayConstruction: return tr("Railway Construction"); case GeoDataFeature::RailwayMonorail: return tr("Monorail"); case GeoDataFeature::RailwayFunicular: return tr("Funicular Railway"); case GeoDataFeature::PowerTower: return tr("Power Tower"); case GeoDataFeature::Satellite: return tr("Satellite"); case GeoDataFeature::AdminLevel1: return tr("Admin Boundary (Level 1)"); case GeoDataFeature::AdminLevel2: return tr("Admin Boundary (Level 2)"); case GeoDataFeature::AdminLevel3: return tr("Admin Boundary (Level 3)"); case GeoDataFeature::AdminLevel4: return tr("Admin Boundary (Level 4)"); case GeoDataFeature::AdminLevel5: return tr("Admin Boundary (Level 5)"); case GeoDataFeature::AdminLevel6: return tr("Admin Boundary (Level 6)"); case GeoDataFeature::AdminLevel7: return tr("Admin Boundary (Level 7)"); case GeoDataFeature::AdminLevel8: return tr("Admin Boundary (Level 8)"); case GeoDataFeature::AdminLevel9: return tr("Admin Boundary (Level 9)"); case GeoDataFeature::AdminLevel10: return tr("Admin Boundary (Level 10)"); case GeoDataFeature::AdminLevel11: return tr("Admin Boundary (Level 11)"); case GeoDataFeature::BoundaryMaritime: return tr("Boundary (Maritime)"); case GeoDataFeature::Landmass: return tr("Land Mass"); case GeoDataFeature::UrbanArea: return tr("Urban Area"); case GeoDataFeature::InternationalDateLine: return tr("International Date Line"); case GeoDataFeature::Bathymetry: return tr("Bathymetry"); case GeoDataFeature::Valley: return tr("Valley"); case GeoDataFeature::OtherTerrain: return tr("Terrain"); case GeoDataFeature::Crater: return tr("Crater"); case GeoDataFeature::Mare: return tr("Sea"); case GeoDataFeature::MannedLandingSite: return tr("Manned Landing Site"); case GeoDataFeature::RoboticRover: return tr("Robotic Rover"); case GeoDataFeature::UnmannedSoftLandingSite: return tr("Unmanned Soft Landing Site"); case GeoDataFeature::UnmannedHardLandingSite: return tr("Unmanned Hard Landing Site"); case GeoDataFeature::Mons: return tr("Mountain"); case GeoDataFeature::Default: case GeoDataFeature::Unknown: case GeoDataFeature::None: case GeoDataFeature::LastIndex: return QString(); } return QString(); } QString m_name; // Name of the feature. Is shown on screen GeoDataSnippet m_snippet; // Snippet of the feature. QString m_description; // A longer textual description bool m_descriptionCDATA; // True if description should be considered CDATA QString m_address; // The address. Optional QString m_phoneNumber; // Phone Optional QString m_styleUrl; // styleUrl Url#tag to a document wide style GeoDataAbstractView* m_abstractView; // AbstractView Optional qint64 m_popularity; // Population/Area/Altitude depending on placemark(!) int m_zoomLevel; // Zoom Level of the feature bool m_visible; // True if this feature should be shown. GeoDataFeature::GeoDataVisualCategory m_visualCategory; // the visual category QString m_role; GeoDataStyle::Ptr m_style; const GeoDataStyleMap* m_styleMap; GeoDataExtendedData m_extendedData; GeoDataTimeSpan m_timeSpan; GeoDataTimeStamp m_timeStamp; GeoDataRegion m_region; QAtomicInt ref; // Static members static const QSharedPointer s_defaultStyle; }; } // namespace Marble #endif diff --git a/src/lib/marble/osm/OsmPresetLibrary.cpp b/src/lib/marble/osm/OsmPresetLibrary.cpp index 2f4c59183..bc9440746 100644 --- a/src/lib/marble/osm/OsmPresetLibrary.cpp +++ b/src/lib/marble/osm/OsmPresetLibrary.cpp @@ -1,593 +1,594 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2015 Marius-Valeriu Stanciu // #include "OsmPresetLibrary.h" #include "GeoDataTypes.h" #include "GeoDataFeature.h" #include "GeoDataPlacemark.h" #include "GeoDataStyle.h" #include "OsmPlacemarkData.h" #include "StyleBuilder.h" #include namespace Marble { QMap OsmPresetLibrary::s_visualCategories; QList OsmPresetLibrary::s_additionalOsmTags; void OsmPresetLibrary::initializeOsmVisualCategories() { // Only initialize the map once if( !s_visualCategories.isEmpty() ) { return; } s_visualCategories[ OsmTag( "admin_level", "1" ) ] = GeoDataFeature::AdminLevel1; s_visualCategories[ OsmTag( "admin_level", "2" ) ] = GeoDataFeature::AdminLevel2; s_visualCategories[ OsmTag( "admin_level", "3" ) ] = GeoDataFeature::AdminLevel3; s_visualCategories[ OsmTag( "admin_level", "4" ) ] = GeoDataFeature::AdminLevel4; s_visualCategories[ OsmTag( "admin_level", "5" ) ] = GeoDataFeature::AdminLevel5; s_visualCategories[ OsmTag( "admin_level", "6" ) ] = GeoDataFeature::AdminLevel6; s_visualCategories[ OsmTag( "admin_level", "7" ) ] = GeoDataFeature::AdminLevel7; s_visualCategories[ OsmTag( "admin_level", "8" ) ] = GeoDataFeature::AdminLevel8; s_visualCategories[ OsmTag( "admin_level", "9" ) ] = GeoDataFeature::AdminLevel9; s_visualCategories[ OsmTag( "admin_level", "10" ) ] = GeoDataFeature::AdminLevel10; s_visualCategories[ OsmTag( "admin_level", "11" ) ] = GeoDataFeature::AdminLevel11; s_visualCategories[ OsmTag( "boundary", "maritime" ) ] = GeoDataFeature::BoundaryMaritime; s_visualCategories[ OsmTag( "amenity", "restaurant" ) ] = GeoDataFeature::FoodRestaurant; s_visualCategories[ OsmTag( "amenity", "fast_food" ) ] = GeoDataFeature::FoodFastFood; s_visualCategories[ OsmTag( "amenity", "pub" ) ] = GeoDataFeature::FoodPub; s_visualCategories[ OsmTag( "amenity", "bar" ) ] = GeoDataFeature::FoodBar; s_visualCategories[ OsmTag( "amenity", "cafe" ) ] = GeoDataFeature::FoodCafe; s_visualCategories[ OsmTag( "amenity", "biergarten" ) ] = GeoDataFeature::FoodBiergarten; s_visualCategories[ OsmTag( "amenity", "school" ) ] = GeoDataFeature::EducationSchool; s_visualCategories[ OsmTag( "amenity", "college" ) ] = GeoDataFeature::EducationCollege; s_visualCategories[ OsmTag( "amenity", "library" ) ] = GeoDataFeature::AmenityLibrary; s_visualCategories[ OsmTag( "amenity", "kindergarten" ) ] = GeoDataFeature::AmenityKindergarten; s_visualCategories[ OsmTag( "amenity", "childcare" ) ] = GeoDataFeature::AmenityKindergarten; s_visualCategories[ OsmTag( "amenity", "university" ) ] = GeoDataFeature::EducationUniversity; s_visualCategories[ OsmTag( "amenity", "bus_station" ) ] = GeoDataFeature::TransportBusStation; s_visualCategories[ OsmTag( "amenity", "car_sharing" ) ] = GeoDataFeature::TransportCarShare; s_visualCategories[ OsmTag( "amenity", "fuel" ) ] = GeoDataFeature::TransportFuel; s_visualCategories[ OsmTag( "amenity", "parking" ) ] = GeoDataFeature::TransportParking; s_visualCategories[ OsmTag( "amenity", "parking_space" ) ] = GeoDataFeature::TransportParkingSpace; s_visualCategories[ OsmTag( "amenity", "atm" ) ] = GeoDataFeature::MoneyAtm; s_visualCategories[ OsmTag( "amenity", "bank" ) ] = GeoDataFeature::MoneyBank; s_visualCategories[ OsmTag( "historic", "archaeological_site" ) ] = GeoDataFeature::AmenityArchaeologicalSite; s_visualCategories[ OsmTag( "amenity", "embassy" ) ] = GeoDataFeature::AmenityEmbassy; s_visualCategories[ OsmTag( "emergency", "phone" ) ] = GeoDataFeature::AmenityEmergencyPhone; s_visualCategories[ OsmTag( "leisure", "water_park" ) ] = GeoDataFeature::AmenityWaterPark; s_visualCategories[ OsmTag( "amenity", "community_centre" ) ] = GeoDataFeature::AmenityCommunityCentre; s_visualCategories[ OsmTag( "amenity", "fountain" ) ] = GeoDataFeature::AmenityFountain; s_visualCategories[ OsmTag( "amenity", "nightclub" ) ] = GeoDataFeature::AmenityNightClub; s_visualCategories[ OsmTag( "amenity", "bench" ) ] = GeoDataFeature::AmenityBench; s_visualCategories[ OsmTag( "amenity", "courthouse" ) ] = GeoDataFeature::AmenityCourtHouse; s_visualCategories[ OsmTag( "amenity", "fire_station" ) ] = GeoDataFeature::AmenityFireStation; s_visualCategories[ OsmTag( "amenity", "hunting_stand" ) ] = GeoDataFeature::AmenityHuntingStand; s_visualCategories[ OsmTag( "amenity", "police" ) ] = GeoDataFeature::AmenityPolice; s_visualCategories[ OsmTag( "amenity", "post_box" ) ] = GeoDataFeature::AmenityPostBox; s_visualCategories[ OsmTag( "amenity", "post_office" ) ] = GeoDataFeature::AmenityPostOffice; s_visualCategories[ OsmTag( "amenity", "prison" ) ] = GeoDataFeature::AmenityPrison; s_visualCategories[ OsmTag( "amenity", "recycling" ) ] = GeoDataFeature::AmenityRecycling; s_visualCategories[ OsmTag( "amenity", "shelter" ) ] = GeoDataFeature::AmenityShelter; s_visualCategories[ OsmTag( "amenity", "telephone" ) ] = GeoDataFeature::AmenityTelephone; s_visualCategories[ OsmTag( "amenity", "toilets" ) ] = GeoDataFeature::AmenityToilets; s_visualCategories[ OsmTag( "amenity", "townhall" ) ] = GeoDataFeature::AmenityTownHall; s_visualCategories[ OsmTag( "amenity", "waste_basket" ) ] = GeoDataFeature::AmenityWasteBasket; s_visualCategories[ OsmTag( "amenity", "drinking_water" ) ] = GeoDataFeature::AmenityDrinkingWater; s_visualCategories[ OsmTag( "amenity", "graveyard" ) ] = GeoDataFeature::AmenityGraveyard; s_visualCategories[ OsmTag( "amenity", "dentist" ) ] = GeoDataFeature::HealthDentist; s_visualCategories[ OsmTag( "amenity", "pharmacy" ) ] = GeoDataFeature::HealthPharmacy; s_visualCategories[ OsmTag( "amenity", "hospital" ) ] = GeoDataFeature::HealthHospital; s_visualCategories[ OsmTag( "amenity", "doctors" ) ] = GeoDataFeature::HealthDoctors; s_visualCategories[ OsmTag( "amenity", "veterinary" ) ] = GeoDataFeature::HealthVeterinary; s_visualCategories[ OsmTag( "amenity", "cinema" ) ] = GeoDataFeature::TouristCinema; s_visualCategories[ OsmTag( "tourism", "information" ) ] = GeoDataFeature::TouristInformation; s_visualCategories[ OsmTag( "amenity", "theatre" ) ] = GeoDataFeature::TouristTheatre; s_visualCategories[ OsmTag( "amenity", "place_of_worship" ) ] = GeoDataFeature::ReligionPlaceOfWorship; s_visualCategories[ OsmTag( "natural", "peak" ) ] = GeoDataFeature::NaturalPeak; s_visualCategories[ OsmTag( "natural", "tree" ) ] = GeoDataFeature::NaturalTree; s_visualCategories[ OsmTag( "shop", "beverages" ) ] = GeoDataFeature::ShopBeverages; s_visualCategories[ OsmTag( "shop", "hifi" ) ] = GeoDataFeature::ShopHifi; s_visualCategories[ OsmTag( "shop", "supermarket" ) ] = GeoDataFeature::ShopSupermarket; s_visualCategories[ OsmTag( "shop", "alcohol" ) ] = GeoDataFeature::ShopAlcohol; s_visualCategories[ OsmTag( "shop", "bakery" ) ] = GeoDataFeature::ShopBakery; s_visualCategories[ OsmTag( "shop", "butcher" ) ] = GeoDataFeature::ShopButcher; s_visualCategories[ OsmTag( "shop", "confectionery" ) ] = GeoDataFeature::ShopConfectionery; s_visualCategories[ OsmTag( "shop", "convenience" ) ] = GeoDataFeature::ShopConvenience; s_visualCategories[ OsmTag( "shop", "greengrocer" ) ] = GeoDataFeature::ShopGreengrocer; s_visualCategories[ OsmTag( "shop", "seafood" ) ] = GeoDataFeature::ShopSeafood; s_visualCategories[ OsmTag( "shop", "department_store" ) ] = GeoDataFeature::ShopDepartmentStore; s_visualCategories[ OsmTag( "shop", "kiosk" ) ] = GeoDataFeature::ShopKiosk; s_visualCategories[ OsmTag( "shop", "bag" ) ] = GeoDataFeature::ShopBag; s_visualCategories[ OsmTag( "shop", "clothes" ) ] = GeoDataFeature::ShopClothes; s_visualCategories[ OsmTag( "shop", "fashion" ) ] = GeoDataFeature::ShopFashion; s_visualCategories[ OsmTag( "shop", "jewelry" ) ] = GeoDataFeature::ShopJewelry; s_visualCategories[ OsmTag( "shop", "shoes" ) ] = GeoDataFeature::ShopShoes; s_visualCategories[ OsmTag( "shop", "variety_store" ) ] = GeoDataFeature::ShopVarietyStore; s_visualCategories[ OsmTag( "shop", "beauty" ) ] = GeoDataFeature::ShopBeauty; s_visualCategories[ OsmTag( "shop", "chemist" ) ] = GeoDataFeature::ShopChemist; s_visualCategories[ OsmTag( "shop", "cosmetics" ) ] = GeoDataFeature::ShopCosmetics; s_visualCategories[ OsmTag( "shop", "hairdresser" ) ] = GeoDataFeature::ShopHairdresser; s_visualCategories[ OsmTag( "shop", "optician" ) ] = GeoDataFeature::ShopOptician; s_visualCategories[ OsmTag( "shop", "perfumery" ) ] = GeoDataFeature::ShopPerfumery; s_visualCategories[ OsmTag( "shop", "doityourself" ) ] = GeoDataFeature::ShopDoitYourself; s_visualCategories[ OsmTag( "shop", "florist" ) ] = GeoDataFeature::ShopFlorist; s_visualCategories[ OsmTag( "shop", "hardware" ) ] = GeoDataFeature::ShopHardware; s_visualCategories[ OsmTag( "shop", "furniture" ) ] = GeoDataFeature::ShopFurniture; s_visualCategories[ OsmTag( "shop", "electronics" ) ] = GeoDataFeature::ShopElectronics; s_visualCategories[ OsmTag( "shop", "mobile_phone" ) ] = GeoDataFeature::ShopMobilePhone; s_visualCategories[ OsmTag( "shop", "bicycle" ) ] = GeoDataFeature::ShopBicycle; s_visualCategories[ OsmTag( "shop", "car" ) ] = GeoDataFeature::ShopCar; s_visualCategories[ OsmTag( "shop", "car_repair" ) ] = GeoDataFeature::ShopCarRepair; s_visualCategories[ OsmTag( "shop", "car_parts" ) ] = GeoDataFeature::ShopCarParts; s_visualCategories[ OsmTag( "shop", "motorcycle" ) ] = GeoDataFeature::ShopMotorcycle; s_visualCategories[ OsmTag( "shop", "outdoor" ) ] = GeoDataFeature::ShopOutdoor; s_visualCategories[ OsmTag( "shop", "musical_instrument" ) ] = GeoDataFeature::ShopMusicalInstrument; s_visualCategories[ OsmTag( "shop", "photo" ) ] = GeoDataFeature::ShopPhoto; s_visualCategories[ OsmTag( "shop", "books" ) ] = GeoDataFeature::ShopBook; s_visualCategories[ OsmTag( "shop", "gift" ) ] = GeoDataFeature::ShopGift; s_visualCategories[ OsmTag( "shop", "stationery" ) ] = GeoDataFeature::ShopStationery; s_visualCategories[ OsmTag( "shop", "laundry" ) ] = GeoDataFeature::ShopLaundry; s_visualCategories[ OsmTag( "shop", "pet" ) ] = GeoDataFeature::ShopPet; s_visualCategories[ OsmTag( "shop", "toys" ) ] = GeoDataFeature::ShopToys; s_visualCategories[ OsmTag( "shop", "travel_agency" ) ] = GeoDataFeature::ShopTravelAgency; // Default for all other shops foreach(const QString &value, shopValues() ) { s_visualCategories[ OsmTag( "shop", value ) ] = GeoDataFeature::Shop; } s_visualCategories[ OsmTag( "man_made", "bridge" ) ] = GeoDataFeature::ManmadeBridge; s_visualCategories[ OsmTag( "man_made", "lighthouse" ) ] = GeoDataFeature::ManmadeLighthouse; s_visualCategories[ OsmTag( "man_made", "pier" ) ] = GeoDataFeature::ManmadePier; s_visualCategories[ OsmTag( "man_made", "water_tower" ) ] = GeoDataFeature::ManmadeWaterTower; s_visualCategories[ OsmTag( "man_made", "windmill" ) ] = GeoDataFeature::ManmadeWindMill; s_visualCategories[ OsmTag( "religion", "" ) ] = GeoDataFeature::ReligionPlaceOfWorship; s_visualCategories[ OsmTag( "religion", "bahai" ) ] = GeoDataFeature::ReligionBahai; s_visualCategories[ OsmTag( "religion", "buddhist" ) ] = GeoDataFeature::ReligionBuddhist; s_visualCategories[ OsmTag( "religion", "christian" ) ] = GeoDataFeature::ReligionChristian; s_visualCategories[ OsmTag( "religion", "muslim" ) ] = GeoDataFeature::ReligionMuslim; s_visualCategories[ OsmTag( "religion", "hindu" ) ] = GeoDataFeature::ReligionHindu; s_visualCategories[ OsmTag( "religion", "jain" ) ] = GeoDataFeature::ReligionJain; s_visualCategories[ OsmTag( "religion", "jewish" ) ] = GeoDataFeature::ReligionJewish; s_visualCategories[ OsmTag( "religion", "shinto" ) ] = GeoDataFeature::ReligionShinto; s_visualCategories[ OsmTag( "religion", "sikh" ) ] = GeoDataFeature::ReligionSikh; s_visualCategories[ OsmTag( "historic", "memorial" ) ] = GeoDataFeature::TouristAttraction; s_visualCategories[ OsmTag( "tourism", "attraction" ) ] = GeoDataFeature::TouristAttraction; s_visualCategories[ OsmTag( "tourism", "camp_site" ) ] = GeoDataFeature::AccomodationCamping; s_visualCategories[ OsmTag( "tourism", "hostel" ) ] = GeoDataFeature::AccomodationHostel; s_visualCategories[ OsmTag( "tourism", "hotel" ) ] = GeoDataFeature::AccomodationHotel; s_visualCategories[ OsmTag( "tourism", "motel" ) ] = GeoDataFeature::AccomodationMotel; s_visualCategories[ OsmTag( "tourism", "guest_house" ) ] = GeoDataFeature::AccomodationGuestHouse; s_visualCategories[ OsmTag( "tourism", "museum" ) ] = GeoDataFeature::TouristMuseum; s_visualCategories[ OsmTag( "tourism", "theme_park" ) ] = GeoDataFeature::TouristThemePark; s_visualCategories[ OsmTag( "tourism", "viewpoint" ) ] = GeoDataFeature::TouristViewPoint; s_visualCategories[ OsmTag( "tourism", "zoo" ) ] = GeoDataFeature::TouristZoo; s_visualCategories[ OsmTag( "tourism", "alpine_hut" ) ] = GeoDataFeature::TouristAlpineHut; s_visualCategories[ OsmTag( "barrier", "city_wall" ) ] = GeoDataFeature::BarrierCityWall; s_visualCategories[ OsmTag( "barrier", "gate" ) ] = GeoDataFeature::BarrierGate; s_visualCategories[ OsmTag( "barrier", "lift_gate" ) ] = GeoDataFeature::BarrierLiftGate; s_visualCategories[ OsmTag( "barrier", "wall" ) ] = GeoDataFeature::BarrierWall; s_visualCategories[ OsmTag( "historic", "castle" ) ] = GeoDataFeature::TouristCastle; s_visualCategories[ OsmTag( "historic", "fort" ) ] = GeoDataFeature::TouristCastle; s_visualCategories[ OsmTag( "historic", "monument" ) ] = GeoDataFeature::TouristMonument; s_visualCategories[ OsmTag( "historic", "ruins" ) ] = GeoDataFeature::TouristRuin; s_visualCategories[ OsmTag( "highway", "traffic_signals" ) ] = GeoDataFeature::HighwayTrafficSignals; s_visualCategories[ OsmTag( "highway", "unknown" ) ] = GeoDataFeature::HighwayUnknown; s_visualCategories[ OsmTag( "highway", "steps" ) ] = GeoDataFeature::HighwaySteps; s_visualCategories[ OsmTag( "highway", "footway" ) ] = GeoDataFeature::HighwayFootway; s_visualCategories[ OsmTag( "highway", "cycleway" ) ] = GeoDataFeature::HighwayCycleway; s_visualCategories[ OsmTag( "highway", "path" ) ] = GeoDataFeature::HighwayPath; s_visualCategories[ OsmTag( "highway", "track" ) ] = GeoDataFeature::HighwayTrack; s_visualCategories[ OsmTag( "highway", "pedestrian" ) ] = GeoDataFeature::HighwayPedestrian; s_visualCategories[ OsmTag( "highway", "service" ) ] = GeoDataFeature::HighwayService; s_visualCategories[ OsmTag( "highway", "living_street" ) ] = GeoDataFeature::HighwayLivingStreet; s_visualCategories[ OsmTag( "highway", "unclassified" ) ] = GeoDataFeature::HighwayUnclassified; s_visualCategories[ OsmTag( "highway", "residential" ) ] = GeoDataFeature::HighwayResidential; s_visualCategories[ OsmTag( "highway", "road" ) ] = GeoDataFeature::HighwayRoad; s_visualCategories[ OsmTag( "highway", "tertiary_link" ) ] = GeoDataFeature::HighwayTertiaryLink; s_visualCategories[ OsmTag( "highway", "tertiary" ) ] = GeoDataFeature::HighwayTertiary; s_visualCategories[ OsmTag( "highway", "secondary_link" ) ] = GeoDataFeature::HighwaySecondaryLink; s_visualCategories[ OsmTag( "highway", "secondary" ) ] = GeoDataFeature::HighwaySecondary; s_visualCategories[ OsmTag( "highway", "primary_link" ) ] = GeoDataFeature::HighwayPrimaryLink; s_visualCategories[ OsmTag( "highway", "primary" ) ] = GeoDataFeature::HighwayPrimary; s_visualCategories[ OsmTag( "highway", "trunk_link" ) ] = GeoDataFeature::HighwayTrunkLink; s_visualCategories[ OsmTag( "highway", "trunk" ) ] = GeoDataFeature::HighwayTrunk; s_visualCategories[ OsmTag( "highway", "motorway_link" ) ] = GeoDataFeature::HighwayMotorwayLink; s_visualCategories[ OsmTag( "highway", "motorway" ) ] = GeoDataFeature::HighwayMotorway; s_visualCategories[ OsmTag( "natural", "water" ) ] = GeoDataFeature::NaturalWater; s_visualCategories[ OsmTag( "natural", "reef" ) ] = GeoDataFeature::NaturalReef; s_visualCategories[ OsmTag( "natural", "bay" ) ] = GeoDataFeature::NaturalWater; s_visualCategories[ OsmTag( "natural", "coastline" ) ] = GeoDataFeature::NaturalWater; s_visualCategories[ OsmTag( "waterway", "stream" ) ] = GeoDataFeature::NaturalWater; s_visualCategories[ OsmTag( "waterway", "river" ) ] = GeoDataFeature::NaturalWater; s_visualCategories[ OsmTag( "waterway", "riverbank" ) ] = GeoDataFeature::NaturalWater; s_visualCategories[ OsmTag( "waterway", "canal" ) ] = GeoDataFeature::NaturalWater; s_visualCategories[ OsmTag( "natural", "wood" ) ] = GeoDataFeature::NaturalWood; s_visualCategories[ OsmTag( "natural", "beach" ) ] = GeoDataFeature::NaturalBeach; s_visualCategories[ OsmTag( "natural", "wetland" ) ] = GeoDataFeature::NaturalWetland; s_visualCategories[ OsmTag( "natural", "glacier" ) ] = GeoDataFeature::NaturalGlacier; s_visualCategories[ OsmTag( "glacier:type", "shelf" ) ] = GeoDataFeature::NaturalIceShelf; s_visualCategories[ OsmTag( "natural", "scrub" ) ] = GeoDataFeature::NaturalScrub; s_visualCategories[ OsmTag( "natural", "cliff" ) ] = GeoDataFeature::NaturalCliff; s_visualCategories[ OsmTag( "military", "danger_area" ) ] = GeoDataFeature::MilitaryDangerArea; s_visualCategories[ OsmTag( "landuse", "forest" ) ] = GeoDataFeature::NaturalWood; s_visualCategories[ OsmTag( "landuse", "allotments" ) ] = GeoDataFeature::LanduseAllotments; s_visualCategories[ OsmTag( "landuse", "basin" ) ] = GeoDataFeature::LanduseBasin; s_visualCategories[ OsmTag( "landuse", "brownfield" ) ] = GeoDataFeature::LanduseConstruction; s_visualCategories[ OsmTag( "landuse", "cemetery" ) ] = GeoDataFeature::LanduseCemetery; s_visualCategories[ OsmTag( "landuse", "commercial" ) ] = GeoDataFeature::LanduseCommercial; s_visualCategories[ OsmTag( "landuse", "construction" ) ] = GeoDataFeature::LanduseConstruction; s_visualCategories[ OsmTag( "landuse", "farm" ) ] = GeoDataFeature::LanduseFarmland; s_visualCategories[ OsmTag( "landuse", "farmland" ) ] = GeoDataFeature::LanduseFarmland; s_visualCategories[ OsmTag( "landuse", "greenhouse_horticulture" ) ] = GeoDataFeature::LanduseFarmland; s_visualCategories[ OsmTag( "landuse", "farmyard" ) ] = GeoDataFeature::LanduseFarmland; s_visualCategories[ OsmTag( "landuse", "garages" ) ] = GeoDataFeature::LanduseGarages; s_visualCategories[ OsmTag( "landuse", "greenfield" ) ] = GeoDataFeature::LanduseConstruction; s_visualCategories[ OsmTag( "landuse", "industrial" ) ] = GeoDataFeature::LanduseIndustrial; s_visualCategories[ OsmTag( "landuse", "landfill" ) ] = GeoDataFeature::LanduseLandfill; s_visualCategories[ OsmTag( "landuse", "meadow" ) ] = GeoDataFeature::LanduseMeadow; s_visualCategories[ OsmTag( "landuse", "military" ) ] = GeoDataFeature::LanduseMilitary; s_visualCategories[ OsmTag( "landuse", "orchard" ) ] = GeoDataFeature::LanduseFarmland; s_visualCategories[ OsmTag( "landuse", "quarry" ) ] = GeoDataFeature::LanduseQuarry; s_visualCategories[ OsmTag( "landuse", "railway" ) ] = GeoDataFeature::LanduseRailway; s_visualCategories[ OsmTag( "landuse", "recreation_ground" ) ] = GeoDataFeature::LeisurePark; s_visualCategories[ OsmTag( "landuse", "reservoir" ) ] = GeoDataFeature::LanduseReservoir; s_visualCategories[ OsmTag( "landuse", "residential" ) ] = GeoDataFeature::LanduseResidential; s_visualCategories[ OsmTag( "landuse", "retail" ) ] = GeoDataFeature::LanduseRetail; s_visualCategories[ OsmTag( "landuse", "orchard" ) ] = GeoDataFeature::LanduseOrchard; s_visualCategories[ OsmTag( "landuse", "vineyard" ) ] = GeoDataFeature::LanduseVineyard; s_visualCategories[ OsmTag( "landuse", "village_green" ) ] = GeoDataFeature::LanduseGrass; s_visualCategories[ OsmTag( "landuse", "grass" ) ] = GeoDataFeature::LanduseGrass; s_visualCategories[ OsmTag( "leisure", "common" ) ] = GeoDataFeature::LanduseGrass; s_visualCategories[ OsmTag( "leisure", "garden" ) ] = GeoDataFeature::LanduseGrass; s_visualCategories[ OsmTag( "leisure", "golf_course" ) ] = GeoDataFeature::LeisureGolfCourse; s_visualCategories[ OsmTag( "leisure", "marina" ) ] = GeoDataFeature::LeisureMarina; s_visualCategories[ OsmTag( "leisure", "park" ) ] = GeoDataFeature::LeisurePark; s_visualCategories[ OsmTag( "leisure", "playground" ) ] = GeoDataFeature::LeisurePlayground; s_visualCategories[ OsmTag( "leisure", "pitch" ) ] = GeoDataFeature::LeisurePitch; s_visualCategories[ OsmTag( "leisure", "sports_centre" ) ] = GeoDataFeature::LeisureSportsCentre; s_visualCategories[ OsmTag( "leisure", "stadium" ) ] = GeoDataFeature::LeisureStadium; s_visualCategories[ OsmTag( "leisure", "track" ) ] = GeoDataFeature::LeisureTrack; s_visualCategories[ OsmTag( "leisure", "swimming_pool" ) ] = GeoDataFeature::LeisureSwimmingPool; s_visualCategories[ OsmTag( "railway", "rail" ) ] = GeoDataFeature::RailwayRail; s_visualCategories[ OsmTag( "railway", "narrow_gauge" ) ] = GeoDataFeature::RailwayNarrowGauge; s_visualCategories[ OsmTag( "railway", "tram" ) ] = GeoDataFeature::RailwayTram; s_visualCategories[ OsmTag( "railway", "light_rail" ) ] = GeoDataFeature::RailwayLightRail; s_visualCategories[ OsmTag( "railway", "preserved" ) ] = GeoDataFeature::RailwayPreserved; s_visualCategories[ OsmTag( "railway", "abandoned" ) ] = GeoDataFeature::RailwayAbandoned; s_visualCategories[ OsmTag( "railway", "disused" ) ] = GeoDataFeature::RailwayAbandoned; s_visualCategories[ OsmTag( "railway", "razed" ) ] = GeoDataFeature::RailwayAbandoned; s_visualCategories[ OsmTag( "railway", "subway" ) ] = GeoDataFeature::RailwaySubway; s_visualCategories[ OsmTag( "railway", "miniature" ) ] = GeoDataFeature::RailwayMiniature; s_visualCategories[ OsmTag( "railway", "construction" ) ] = GeoDataFeature::RailwayConstruction; s_visualCategories[ OsmTag( "railway", "monorail" ) ] = GeoDataFeature::RailwayMonorail; s_visualCategories[ OsmTag( "railway", "funicular" ) ] = GeoDataFeature::RailwayFunicular; s_visualCategories[ OsmTag( "railway", "platform" ) ] = GeoDataFeature::TransportPlatform; s_visualCategories[ OsmTag( "railway", "station" ) ] = GeoDataFeature::TransportTrainStation; s_visualCategories[ OsmTag( "railway", "halt" ) ] = GeoDataFeature::TransportTrainStation; s_visualCategories[ OsmTag( "power", "tower" ) ] = GeoDataFeature::PowerTower; s_visualCategories[ OsmTag( "aeroway", "aerodrome" ) ] = GeoDataFeature::TransportAerodrome; s_visualCategories[ OsmTag( "aeroway", "helipad" ) ] = GeoDataFeature::TransportHelipad; s_visualCategories[ OsmTag( "aeroway", "gate" ) ] = GeoDataFeature::TransportAirportGate; s_visualCategories[ OsmTag( "aeroway", "runway" ) ] = GeoDataFeature::TransportAirportRunway; + s_visualCategories[ OsmTag( "aeroway", "taxiway" ) ] = GeoDataFeature::TransportAirportTaxiway; s_visualCategories[ OsmTag( "transport", "airpor_terminal" ) ] = GeoDataFeature::TransportAirportTerminal; s_visualCategories[ OsmTag( "transport", "bus_station" ) ] = GeoDataFeature::TransportBusStation; s_visualCategories[ OsmTag( "highway", "bus_stop" ) ] = GeoDataFeature::TransportBusStop; s_visualCategories[ OsmTag( "transport", "car_share" ) ] = GeoDataFeature::TransportCarShare; s_visualCategories[ OsmTag( "transport", "fuel" ) ] = GeoDataFeature::TransportFuel; s_visualCategories[ OsmTag( "transport", "parking" ) ] = GeoDataFeature::TransportParking; s_visualCategories[ OsmTag( "public_transport", "platform" ) ] = GeoDataFeature::TransportPlatform; s_visualCategories[ OsmTag( "amenity", "bicycle_rental" ) ] = GeoDataFeature::TransportRentalBicycle; s_visualCategories[ OsmTag( "amenity", "car_rental" ) ] = GeoDataFeature::TransportRentalCar; s_visualCategories[ OsmTag( "amenity", "taxi" ) ] = GeoDataFeature::TransportTaxiRank; s_visualCategories[ OsmTag( "transport", "train_station" ) ] = GeoDataFeature::TransportTrainStation; s_visualCategories[ OsmTag( "transport", "tram_stop" ) ] = GeoDataFeature::TransportTramStop; s_visualCategories[ OsmTag( "transport", "bus_stop" ) ] = GeoDataFeature::TransportBusStop; s_visualCategories[ OsmTag( "amenity", "bicycle_parking" ) ] = GeoDataFeature::TransportBicycleParking; s_visualCategories[ OsmTag( "amenity", "motorcycle_parking" ) ] = GeoDataFeature::TransportMotorcycleParking; s_visualCategories[ OsmTag( "railway", "subway_entrance" ) ] = GeoDataFeature::TransportSubwayEntrance; s_visualCategories[ OsmTag( "place", "city" ) ] = GeoDataFeature::PlaceCity; s_visualCategories[ OsmTag( "place", "suburb" ) ] = GeoDataFeature::PlaceSuburb; s_visualCategories[ OsmTag( "place", "hamlet" ) ] = GeoDataFeature::PlaceHamlet; s_visualCategories[ OsmTag( "place", "locality" ) ] = GeoDataFeature::PlaceLocality; s_visualCategories[ OsmTag( "place", "town" ) ] = GeoDataFeature::PlaceTown; s_visualCategories[ OsmTag( "place", "village" ) ] = GeoDataFeature::PlaceVillage; //Custom Marble OSM Tags s_visualCategories[ OsmTag( "marble_land", "landmass" ) ] = GeoDataFeature::Landmass; s_visualCategories[ OsmTag( "settlement", "yes" ) ] = GeoDataFeature::UrbanArea; s_visualCategories[ OsmTag( "marble_line", "date" ) ] = GeoDataFeature::InternationalDateLine; s_visualCategories[ OsmTag( "marble:feature", "bathymetry" ) ] = GeoDataFeature::Bathymetry; // Default for buildings foreach(const QString &value, buildingValues() ) { s_visualCategories[ OsmTag( "building", value ) ] = GeoDataFeature::Building; } } void OsmPresetLibrary::initializeAdditionalOsmTags() { // Only initialize the list once if( !s_additionalOsmTags.isEmpty() ) { return; } // Recommended for nodes s_additionalOsmTags << OsmTag( "power", "pole" ); s_additionalOsmTags << OsmTag( "power", "generator" ); s_additionalOsmTags << OsmTag( "barrier", "fence" ); s_additionalOsmTags << OsmTag( "barrier", "wall" ); s_additionalOsmTags << OsmTag( "barrier", "gate" ); // Recommended for ways s_additionalOsmTags << OsmTag( "lanes", "" ); s_additionalOsmTags << OsmTag( "maxspeed", "" ); s_additionalOsmTags << OsmTag( "maxheight", "" ); s_additionalOsmTags << OsmTag( "maxweight", "" ); s_additionalOsmTags << OsmTag( "oneway", "yes" ); s_additionalOsmTags << OsmTag( "service", "driveway" ); s_additionalOsmTags << OsmTag( "service", "parking_aisle" ); s_additionalOsmTags << OsmTag( "service", "alley" ); s_additionalOsmTags << OsmTag( "tunnel", "yes" ); s_additionalOsmTags << OsmTag( "abutters", "commercial" ); s_additionalOsmTags << OsmTag( "abutters", "industrial" ); s_additionalOsmTags << OsmTag( "abutters", "mixed" ); s_additionalOsmTags << OsmTag( "abutters", "residential" ); // Recommended for areas s_additionalOsmTags << OsmTag( "surface", "unpaved" ); s_additionalOsmTags << OsmTag( "surface", "paved" ); s_additionalOsmTags << OsmTag( "surface", "gravel" ); s_additionalOsmTags << OsmTag( "surface", "dirt" ); s_additionalOsmTags << OsmTag( "surface", "grass" ); // Relations s_additionalOsmTags << OsmTag( "type", "route" ); s_additionalOsmTags << OsmTag( "type", "route_master" ); s_additionalOsmTags << OsmTag( "type", "public_transport" ); s_additionalOsmTags << OsmTag( "type", "destination_sign" ); s_additionalOsmTags << OsmTag( "type", "waterway" ); s_additionalOsmTags << OsmTag( "type", "enforcement" ); // Relations: route s_additionalOsmTags << OsmTag( "route", "road" ); s_additionalOsmTags << OsmTag( "route", "bicycle" ); s_additionalOsmTags << OsmTag( "route", "foot" ); s_additionalOsmTags << OsmTag( "route", "hiking" ); s_additionalOsmTags << OsmTag( "route", "bus" ); s_additionalOsmTags << OsmTag( "route", "trolleybus" ); s_additionalOsmTags << OsmTag( "route", "ferry" ); s_additionalOsmTags << OsmTag( "route", "detour" ); s_additionalOsmTags << OsmTag( "route", "train" ); s_additionalOsmTags << OsmTag( "route", "tram" ); s_additionalOsmTags << OsmTag( "route", "mtb" ); s_additionalOsmTags << OsmTag( "route", "horse" ); s_additionalOsmTags << OsmTag( "route", "ski" ); s_additionalOsmTags << OsmTag( "roundtrip", "yes" ); s_additionalOsmTags << OsmTag( "network", "" ); s_additionalOsmTags << OsmTag( "ref", "" ); s_additionalOsmTags << OsmTag( "operator", "" ); // Relations: route_master s_additionalOsmTags << OsmTag( "route_master", "train" ); s_additionalOsmTags << OsmTag( "route_master", "subway" ); s_additionalOsmTags << OsmTag( "route_master", "monorail" ); s_additionalOsmTags << OsmTag( "route_master", "tram" ); s_additionalOsmTags << OsmTag( "route_master", "bus" ); s_additionalOsmTags << OsmTag( "route_master", "trolleybus" ); s_additionalOsmTags << OsmTag( "route_master", "ferry" ); s_additionalOsmTags << OsmTag( "route_master", "bicycle" ); // Relations: public_transport s_additionalOsmTags << OsmTag( "public_transport", "stop_area" ); s_additionalOsmTags << OsmTag( "public_transport", "stop_area_group" ); // Relations: waterway s_additionalOsmTags << OsmTag( "waterway", "river" ); s_additionalOsmTags << OsmTag( "waterway", "stream" ); s_additionalOsmTags << OsmTag( "waterway", "canal" ); s_additionalOsmTags << OsmTag( "waterway", "drain" ); s_additionalOsmTags << OsmTag( "waterway", "ditch" ); // Relations: enforcement s_additionalOsmTags << OsmTag( "enforcement", "maxheight" ); s_additionalOsmTags << OsmTag( "enforcement", "maxweight" ); s_additionalOsmTags << OsmTag( "enforcement", "maxspeed" ); s_additionalOsmTags << OsmTag( "enforcement", "mindistance" ); s_additionalOsmTags << OsmTag( "enforcement", "traffic_signals" ); s_additionalOsmTags << OsmTag( "enforcement", "check" ); s_additionalOsmTags << OsmTag( "enforcement", "access" ); s_additionalOsmTags << OsmTag( "enforcement", "toll" ); // Others s_additionalOsmTags << OsmTag( "height", "" ); s_additionalOsmTags << OsmTag( "rooms", "" ); s_additionalOsmTags << OsmTag( "beds", "" ); s_additionalOsmTags << OsmTag( "wheelchair", "" ); s_additionalOsmTags << OsmTag( "website", "" ); s_additionalOsmTags << OsmTag( "email", "" ); s_additionalOsmTags << OsmTag( "fee", "" ); s_additionalOsmTags << OsmTag( "destination", "" ); s_additionalOsmTags << OsmTag( "indoor", "yes" ); // Recommended for all s_additionalOsmTags << OsmTag( "addr:street", "" ); s_additionalOsmTags << OsmTag( "addr:housenumber", "" ); s_additionalOsmTags << OsmTag( "addr:postcode", "" ); s_additionalOsmTags << OsmTag( "addr:country", "" ); s_additionalOsmTags << OsmTag( "access", "private" ); s_additionalOsmTags << OsmTag( "access", "permissive" ); } GeoDataStyle::ConstPtr OsmPresetLibrary::presetStyle( const OsmTag &tag ) { static const StyleBuilder styleBuilder; const GeoDataFeature::GeoDataVisualCategory category = osmVisualCategory(tag.first + '=' + tag.second); return styleBuilder.presetStyle(category); } bool OsmPresetLibrary::hasVisualCategory ( const OsmTag &tag ) { return s_visualCategories.contains( tag ); } GeoDataFeature::GeoDataVisualCategory OsmPresetLibrary::osmVisualCategory( const QString &keyValue ) { initializeOsmVisualCategories(); QStringList tokens = keyValue.split( '=' ); if ( tokens.size() != 2 ) { return GeoDataFeature::None; } QString key = tokens.at( 0 ); QString value = tokens.at( 1 ); return s_visualCategories.value( OsmTag( key, value ) ); } QMap::const_iterator OsmPresetLibrary::begin() { initializeOsmVisualCategories(); return s_visualCategories.constBegin(); } QMap::const_iterator OsmPresetLibrary::end() { initializeOsmVisualCategories(); return s_visualCategories.constEnd(); } QList::const_iterator OsmPresetLibrary::additionalTagsBegin() { initializeAdditionalOsmTags(); return s_additionalOsmTags.constBegin(); } QList::const_iterator OsmPresetLibrary::additionalTagsEnd() { initializeAdditionalOsmTags(); return s_additionalOsmTags.constEnd(); } QStringList OsmPresetLibrary::shopValues() { // from https://taginfo.openstreetmap.org/keys/building#values static QStringList osmShopValues = QStringList() << "cheese" << "chocolate" << "coffee" << "deli" << "dairy" << "farm" << "pasta" << "pastry" << "tea" << "wine" << "general" << "mall" << "baby_goods" << "boutique" << "fabric" << "leather" << "tailor" << "watches" << "charity" << "second_hand" << "erotic" << "hearing_aids" << "herbalist" << "massage" << "medical_supply" << "tattoo" << "bathroom_furnishing" << "electrical" << "energy" << "furnace" << "garden_centre" << "garden_furniture" << "gas" << "glaziery" << "houseware" << "locksmith" << "paint" << "trade" << "antiques" << "bed" << "candles" << "carpet" << "curtain" << "interior_decoration" << "kitchen" << "lamps" << "window_blind" << "computer" << "radiotechnics" << "vacuum_cleaner" << "fishing" << "free_flying" << "hunting" << "outdoor" << "scuba_diving" << "sports" << "tyres" << "swimming_pool" << "art" << "craft" << "frame" << "games" << "model" << "music" << "trophy" << "video" << "video_games" << "anime" << "ticket" << "copyshop" << "dry_cleaning" << "e-cigarette" << "funeral_directors" << "money_lender" << "pawnbroker" << "pyrotechnics" << "religion" << "storage_rental" << "tobacco" << "weapons" << "user defined"; return osmShopValues; } QStringList OsmPresetLibrary::buildingValues() { // from https://taginfo.openstreetmap.org/keys/building#values static QStringList osmBuildingValues = QStringList() << "yes" << "house" << "residential" << "garage" << "apartments" << "hut" << "industrial" << "detached" << "roof" << "garages" << "commercial" << "terrace" << "shed" << "school" << "retail" << "farm_auxiliary" << "church" << "cathedral" << "greenhouse" << "barn" << "service" << "manufacture" << "construction" << "cabin" << "farm" << "warehouse" << "House" << "office" << "civic" << "Residential" << "hangar" << "public" << "university" << "hospital" << "chapel" << "hotel" << "train_station" << "dormitory" << "kindergarten" << "stable" << "storage_tank" << "shop" << "college" << "supermarket" << "factory" << "bungalow" << "tower" << "silo" << "storage" << "station" << "education" << "carport" << "houseboat" << "castle" << "social_facility" << "water_tower" << "container" << "exhibition_hall" << "monastery" << "bunker" << "shelter"; return osmBuildingValues; } GeoDataFeature::GeoDataVisualCategory OsmPresetLibrary::determineVisualCategory(const OsmPlacemarkData &osmData) { if (osmData.containsTagKey("building") && buildingValues().contains(osmData.tagValue("building")) ) { return GeoDataFeature::Building; } if( osmData.containsTag("natural", "glacier") && osmData.containsTag("glacier:type", "shelf") ){ return GeoDataFeature::NaturalIceShelf; } for (auto iter = osmData.tagsBegin(), end=osmData.tagsEnd(); iter != end; ++iter) { QString const keyValue = QString("%1=%2").arg(iter.key()).arg(iter.value()); GeoDataFeature::GeoDataVisualCategory category = osmVisualCategory(keyValue); if (category != GeoDataFeature::None) { return osmVisualCategory(keyValue); } } return GeoDataFeature::None; } } diff --git a/src/plugins/runner/local-osm-search/DatabaseQuery.cpp b/src/plugins/runner/local-osm-search/DatabaseQuery.cpp index de510d985..f2ac5c71c 100644 --- a/src/plugins/runner/local-osm-search/DatabaseQuery.cpp +++ b/src/plugins/runner/local-osm-search/DatabaseQuery.cpp @@ -1,212 +1,216 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2011 Dennis Nienhüser // Copyright 2013 Bernhard Beschow // #include "DatabaseQuery.h" #include "GeoDataLatLonBox.h" #include "MarbleModel.h" #include "PositionTracking.h" #include namespace Marble { DatabaseQuery::DatabaseQuery( const MarbleModel* model, const QString &searchTerm, const GeoDataLatLonBox &preferred ) : m_queryType( BroadSearch ), m_resultFormat( AddressFormat ), m_searchTerm( searchTerm.trimmed() ), m_category( OsmPlacemark::UnknownCategory ) { if ( model && model->positionTracking()->status() == PositionProviderStatusAvailable ) { m_position = model->positionTracking()->currentLocation(); m_resultFormat = DistanceFormat; } else if ( !preferred.isEmpty() ) { m_position = preferred.center(); m_resultFormat = AddressFormat; } else { m_resultFormat = AddressFormat; } QStringList terms = m_searchTerm.split(QLatin1Char(','), QString::SkipEmptyParts ); QRegExp streetAndHouse( "^(.*)\\s+(\\d+\\D?)$" ); if ( streetAndHouse.indexIn( terms.first() ) != -1 ) { if ( streetAndHouse.capturedTexts().size() == 3 ) { terms.removeFirst(); terms.push_front( streetAndHouse.capturedTexts().at( 1 ) ); terms.push_front( streetAndHouse.capturedTexts().at( 2 ) ); } } Q_ASSERT( terms.size() > 0 ); if ( terms.size() == 1 ) { m_queryType = isPointOfInterest( m_searchTerm ) ? CategorySearch : BroadSearch; } else if ( terms.size() == 2 ) { m_street = terms.first().trimmed(); m_region = terms.last().trimmed(); m_queryType = isPointOfInterest( m_street ) ? CategorySearch : AddressSearch; } else { m_houseNumber = terms.first().trimmed(); m_street = terms.at( 1 ).trimmed(); m_region = terms.last().trimmed(); // skips 2, 3, ..., if any m_queryType = AddressSearch; } } bool DatabaseQuery::isPointOfInterest( const QString &category ) { static QMap pois; if ( pois.isEmpty() ) { pois[QObject::tr( "pois").toLower()] = OsmPlacemark::UnknownCategory; pois["pois"] = OsmPlacemark::UnknownCategory; pois[QObject::tr( "camping" ).toLower()] = OsmPlacemark::AccomodationCamping; pois["camping"] = OsmPlacemark::AccomodationCamping; pois[QObject::tr( "hostel" ).toLower()] = OsmPlacemark::AccomodationHostel; pois["hostel"] = OsmPlacemark::AccomodationHostel; pois[QObject::tr( "hotel" ).toLower()] = OsmPlacemark::AccomodationHotel; pois["hotel"] = OsmPlacemark::AccomodationHotel; pois[QObject::tr( "motel" ).toLower()] = OsmPlacemark::AccomodationMotel; pois["motel"] = OsmPlacemark::AccomodationMotel; pois[QObject::tr( "youth hostel" ).toLower()] = OsmPlacemark::AccomodationYouthHostel; pois["youth hostel"] = OsmPlacemark::AccomodationYouthHostel; pois[QObject::tr( "library" ).toLower()] = OsmPlacemark::AmenityLibrary; pois["library"] = OsmPlacemark::AmenityLibrary; pois[QObject::tr( "college" ).toLower()] = OsmPlacemark::EducationCollege; pois["college"] = OsmPlacemark::EducationCollege; pois[QObject::tr( "school" ).toLower()] = OsmPlacemark::EducationSchool; pois["school"] = OsmPlacemark::EducationSchool; pois[QObject::tr( "university" ).toLower()] = OsmPlacemark::EducationUniversity; pois["university"] = OsmPlacemark::EducationUniversity; pois[QObject::tr( "bar" ).toLower()] = OsmPlacemark::FoodBar; pois["bar"] = OsmPlacemark::FoodBar; pois[QObject::tr( "biergarten" ).toLower()] = OsmPlacemark::FoodBiergarten; pois["biergarten"] = OsmPlacemark::FoodBiergarten; pois[QObject::tr( "cafe" ).toLower()] = OsmPlacemark::FoodCafe; pois["cafe"] = OsmPlacemark::FoodCafe; pois[QObject::tr( "fast food" ).toLower()] = OsmPlacemark::FoodFastFood; pois["fast food"] = OsmPlacemark::FoodFastFood; pois[QObject::tr( "pub" ).toLower()] = OsmPlacemark::FoodPub; pois["pub"] = OsmPlacemark::FoodPub; pois[QObject::tr( "restaurant" ).toLower()] = OsmPlacemark::FoodRestaurant; pois["restaurant"] = OsmPlacemark::FoodRestaurant; pois[QObject::tr( "doctor" ).toLower()] = OsmPlacemark::HealthDoctors; pois["doctor"] = OsmPlacemark::HealthDoctors; pois[QObject::tr( "hospital" ).toLower()] = OsmPlacemark::HealthHospital; pois["hospital"] = OsmPlacemark::HealthHospital; pois[QObject::tr( "pharmacy" ).toLower()] = OsmPlacemark::HealthPharmacy; pois["pharmacy"] = OsmPlacemark::HealthPharmacy; pois[QObject::tr( "bank" ).toLower()] = OsmPlacemark::MoneyBank; pois["bank"] = OsmPlacemark::MoneyBank; pois[QObject::tr( "beverages" ).toLower()] = OsmPlacemark::ShoppingBeverages; pois["beverages"] = OsmPlacemark::ShoppingBeverages; pois[QObject::tr( "hifi" ).toLower()] = OsmPlacemark::ShoppingHifi; pois["hifi"] = OsmPlacemark::ShoppingHifi; pois[QObject::tr( "supermarket" ).toLower()] = OsmPlacemark::ShoppingSupermarket; pois["supermarket"] = OsmPlacemark::ShoppingSupermarket; pois[QObject::tr( "attraction" ).toLower()] = OsmPlacemark::TouristAttraction; pois["attraction"] = OsmPlacemark::TouristAttraction; pois[QObject::tr( "castle" ).toLower()] = OsmPlacemark::TouristCastle; pois["castle"] = OsmPlacemark::TouristCastle; pois[QObject::tr( "cinema" ).toLower()] = OsmPlacemark::TouristCinema; pois["cinema"] = OsmPlacemark::TouristCinema; pois[QObject::tr( "monument" ).toLower()] = OsmPlacemark::TouristMonument; pois["monument"] = OsmPlacemark::TouristMonument; pois[QObject::tr( "museum" ).toLower()] = OsmPlacemark::TouristMuseum; pois["museum"] = OsmPlacemark::TouristMuseum; pois[QObject::tr( "ruin" ).toLower()] = OsmPlacemark::TouristRuin; pois["ruin"] = OsmPlacemark::TouristRuin; pois[QObject::tr( "theatre" ).toLower()] = OsmPlacemark::TouristTheatre; pois["theatre"] = OsmPlacemark::TouristTheatre; pois[QObject::tr( "theme park" ).toLower()] = OsmPlacemark::TouristThemePark; pois["theme park"] = OsmPlacemark::TouristThemePark; pois[QObject::tr( "view point" ).toLower()] = OsmPlacemark::TouristViewPoint; pois["view point"] = OsmPlacemark::TouristViewPoint; pois[QObject::tr( "zoo" ).toLower()] = OsmPlacemark::TouristZoo; pois["zoo"] = OsmPlacemark::TouristZoo; pois[QObject::tr( "airport" ).toLower()] = OsmPlacemark::TransportAirportTerminal; pois["airport"] = OsmPlacemark::TransportAirportTerminal; + pois[QObject::tr( "airport runway" ).toLower()] = OsmPlacemark::TransportAirportRunway; + pois["airport runway"] = OsmPlacemark::TransportAirportRunway; + pois[QObject::tr( "airport taxiway" ).toLower()] = OsmPlacemark::TransportAirportTaxiway; + pois["airport runway"] = OsmPlacemark::TransportAirportTaxiway; pois[QObject::tr( "bus station" ).toLower()] = OsmPlacemark::TransportBusStation; pois["bus station"] = OsmPlacemark::TransportBusStation; pois[QObject::tr( "bus stop" ).toLower()] = OsmPlacemark::TransportBusStop; pois["bus stop"] = OsmPlacemark::TransportBusStop; pois[QObject::tr( "car share" ).toLower()] = OsmPlacemark::TransportCarShare; pois["car share"] = OsmPlacemark::TransportCarShare; pois[QObject::tr( "fuel" ).toLower()] = OsmPlacemark::TransportFuel; pois["fuel"] = OsmPlacemark::TransportFuel; pois[QObject::tr( "parking" ).toLower()] = OsmPlacemark::TransportParking; pois["parking"] = OsmPlacemark::TransportParking; pois[QObject::tr( "train station" ).toLower()] = OsmPlacemark::TransportTrainStation; pois["train station"] = OsmPlacemark::TransportTrainStation; pois[QObject::tr( "atm" ).toLower()] = OsmPlacemark::MoneyAtm; pois["atm"] = OsmPlacemark::MoneyAtm; pois[QObject::tr( "tram stop" ).toLower()] = OsmPlacemark::TransportTramStop; pois["tram stop"] = OsmPlacemark::TransportTramStop; pois[QObject::tr( "bicycle rental" ).toLower()] = OsmPlacemark::TransportRentalBicycle; pois["bicycle rental"] = OsmPlacemark::TransportRentalBicycle; pois[QObject::tr( "car rental" ).toLower()] = OsmPlacemark::TransportRentalCar; pois["car rental"] = OsmPlacemark::TransportRentalCar; pois[QObject::tr( "speed camera" ).toLower()] = OsmPlacemark::TransportSpeedCamera; pois["speed camera"] = OsmPlacemark::TransportSpeedCamera; pois[QObject::tr( "taxi" ).toLower()] = OsmPlacemark::TransportTaxiRank; pois["taxi"] = OsmPlacemark::TransportTaxiRank; } Q_ASSERT( !pois.isEmpty() ); QString const searchTerm = category.toLower(); if ( pois.contains( searchTerm ) ) { m_category = pois[searchTerm]; return true; } m_category = OsmPlacemark::UnknownCategory; return false; } OsmPlacemark::OsmCategory DatabaseQuery::category() const { return m_category; } DatabaseQuery::QueryType DatabaseQuery::queryType() const { return m_queryType; } DatabaseQuery::ResultFormat DatabaseQuery::resultFormat() const { return m_resultFormat; } QString DatabaseQuery::street() const { return m_street; } QString DatabaseQuery::houseNumber() const { return m_houseNumber; } QString DatabaseQuery::region() const { return m_region; } QString DatabaseQuery::searchTerm() const { return m_searchTerm; } GeoDataCoordinates DatabaseQuery::position() const { return m_position; } } diff --git a/src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp b/src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp index 7c682c49b..16712c08d 100644 --- a/src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp +++ b/src/plugins/runner/local-osm-search/LocalOsmSearchRunner.cpp @@ -1,127 +1,129 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2011 Dennis Nienhüser // Copyright 2013 Bernhard Beschow // #include "LocalOsmSearchRunner.h" #include "DatabaseQuery.h" #include "MarbleDebug.h" #include "GeoDataDocument.h" #include "GeoDataPlacemark.h" #include #include #include namespace Marble { QMap LocalOsmSearchRunner::m_categoryMap; LocalOsmSearchRunner::LocalOsmSearchRunner( const QStringList &databaseFiles, QObject *parent ) : SearchRunner( parent ), m_database( databaseFiles ) { if ( m_categoryMap.isEmpty() ) { m_categoryMap[OsmPlacemark::UnknownCategory] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::Address] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::AccomodationCamping] = GeoDataFeature::AccomodationCamping; m_categoryMap[OsmPlacemark::AccomodationHostel] = GeoDataFeature::AccomodationHostel; m_categoryMap[OsmPlacemark::AccomodationHotel] = GeoDataFeature::AccomodationHotel; m_categoryMap[OsmPlacemark::AccomodationMotel] = GeoDataFeature::AccomodationMotel; m_categoryMap[OsmPlacemark::AccomodationYouthHostel] = GeoDataFeature::AccomodationYouthHostel; m_categoryMap[OsmPlacemark::AmenityLibrary] = GeoDataFeature::AmenityLibrary; m_categoryMap[OsmPlacemark::EducationCollege] = GeoDataFeature::EducationCollege; m_categoryMap[OsmPlacemark::EducationSchool] = GeoDataFeature::EducationSchool; m_categoryMap[OsmPlacemark::EducationUniversity] = GeoDataFeature::EducationUniversity; m_categoryMap[OsmPlacemark::FoodBar] = GeoDataFeature::FoodBar; m_categoryMap[OsmPlacemark::FoodBiergarten] = GeoDataFeature::FoodBiergarten; m_categoryMap[OsmPlacemark::FoodCafe] = GeoDataFeature::FoodCafe; m_categoryMap[OsmPlacemark::FoodFastFood] = GeoDataFeature::FoodFastFood; m_categoryMap[OsmPlacemark::FoodPub] = GeoDataFeature::FoodPub; m_categoryMap[OsmPlacemark::FoodRestaurant] = GeoDataFeature::FoodRestaurant; m_categoryMap[OsmPlacemark::HealthDoctors] = GeoDataFeature::HealthDoctors; m_categoryMap[OsmPlacemark::HealthHospital] = GeoDataFeature::HealthHospital; m_categoryMap[OsmPlacemark::HealthPharmacy] = GeoDataFeature::HealthPharmacy; m_categoryMap[OsmPlacemark::MoneyAtm] = GeoDataFeature::MoneyAtm; m_categoryMap[OsmPlacemark::MoneyBank] = GeoDataFeature::MoneyBank; m_categoryMap[OsmPlacemark::ShoppingBeverages] = GeoDataFeature::ShopBeverages; m_categoryMap[OsmPlacemark::ShoppingHifi] = GeoDataFeature::ShopHifi; m_categoryMap[OsmPlacemark::ShoppingSupermarket] = GeoDataFeature::ShopSupermarket; m_categoryMap[OsmPlacemark::TouristAttraction] = GeoDataFeature::TouristAttraction; m_categoryMap[OsmPlacemark::TouristCastle] = GeoDataFeature::TouristCastle; m_categoryMap[OsmPlacemark::TouristCinema] = GeoDataFeature::TouristCinema; m_categoryMap[OsmPlacemark::TouristMonument] = GeoDataFeature::TouristMonument; m_categoryMap[OsmPlacemark::TouristMuseum] = GeoDataFeature::TouristMuseum; m_categoryMap[OsmPlacemark::TouristRuin] = GeoDataFeature::TouristRuin; m_categoryMap[OsmPlacemark::TouristTheatre] = GeoDataFeature::TouristTheatre; m_categoryMap[OsmPlacemark::TouristThemePark] = GeoDataFeature::TouristThemePark; m_categoryMap[OsmPlacemark::TouristViewPoint] = GeoDataFeature::TouristViewPoint; m_categoryMap[OsmPlacemark::TouristZoo] = GeoDataFeature::TouristZoo; m_categoryMap[OsmPlacemark::TransportAirport] = GeoDataFeature::TransportAerodrome; m_categoryMap[OsmPlacemark::TransportAirportTerminal] = GeoDataFeature::TransportAirportTerminal; + m_categoryMap[OsmPlacemark::TransportAirportRunway] = GeoDataFeature::TransportAirportRunway; + m_categoryMap[OsmPlacemark::TransportAirportTaxiway] = GeoDataFeature::TransportAirportTaxiway; m_categoryMap[OsmPlacemark::TransportBusStation] = GeoDataFeature::TransportBusStation; m_categoryMap[OsmPlacemark::TransportBusStop] = GeoDataFeature::TransportBusStop; m_categoryMap[OsmPlacemark::TransportCarShare] = GeoDataFeature::TransportCarShare; m_categoryMap[OsmPlacemark::TransportFuel] = GeoDataFeature::TransportFuel; m_categoryMap[OsmPlacemark::TransportParking] = GeoDataFeature::TransportParking; m_categoryMap[OsmPlacemark::TransportTrainStation] = GeoDataFeature::TransportTrainStation; m_categoryMap[OsmPlacemark::TransportTramStop] = GeoDataFeature::TransportTramStop; m_categoryMap[OsmPlacemark::TransportRentalBicycle] = GeoDataFeature::TransportRentalBicycle; m_categoryMap[OsmPlacemark::TransportRentalCar] = GeoDataFeature::TransportRentalCar; m_categoryMap[OsmPlacemark::TransportSpeedCamera] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::TransportTaxiRank] = GeoDataFeature::TransportTaxiRank; m_categoryMap[OsmPlacemark::PlacesRegion] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::PlacesCounty] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::PlacesCity] = GeoDataFeature::LargeCity; m_categoryMap[OsmPlacemark::PlacesTown] = GeoDataFeature::MediumCity; m_categoryMap[OsmPlacemark::PlacesVillage] = GeoDataFeature::SmallCity; m_categoryMap[OsmPlacemark::PlacesHamlet] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::PlacesIsolatedDwelling] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::PlacesSuburb] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::PlacesLocality] = GeoDataFeature::OsmSite; m_categoryMap[OsmPlacemark::PlacesIsland] = GeoDataFeature::OsmSite; } } LocalOsmSearchRunner::~LocalOsmSearchRunner() { } void LocalOsmSearchRunner::search( const QString &searchTerm, const GeoDataLatLonBox &preferred ) { const DatabaseQuery userQuery( model(), searchTerm, preferred ); QVector placemarks = m_database.find( userQuery ); QVector result; foreach( const OsmPlacemark &placemark, placemarks ) { GeoDataPlacemark* hit = new GeoDataPlacemark; hit->setName( placemark.name() ); if ( placemark.category() == OsmPlacemark::Address && !placemark.houseNumber().isEmpty() ) { hit->setName( hit->name() + ' ' + placemark.houseNumber() ); } if ( !placemark.additionalInformation().isEmpty() ) { hit->setName( hit->name() + '(' + placemark.additionalInformation() + ')' ); } if ( placemark.category() != OsmPlacemark::UnknownCategory ) { hit->setVisualCategory( m_categoryMap[placemark.category()] ); } hit->setGeometry( new GeoDataPoint( placemark.longitude(), placemark.latitude(), 0.0, GeoDataCoordinates::Degree ) ); result << hit; } emit searchFinished( result ); } } // namespace Marble #include "moc_LocalOsmSearchRunner.cpp" diff --git a/src/plugins/runner/local-osm-search/OsmPlacemark.h b/src/plugins/runner/local-osm-search/OsmPlacemark.h index b9079215f..7886b3439 100644 --- a/src/plugins/runner/local-osm-search/OsmPlacemark.h +++ b/src/plugins/runner/local-osm-search/OsmPlacemark.h @@ -1,152 +1,153 @@ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2011 Dennis Nienhüser // #ifndef MARBLE_OSMPLACEMARK_H #define MARBLE_OSMPLACEMARK_H #include namespace Marble { class DatabaseQuery; /** * A lightweight data structure to represent points of interest * like addresses with support for serialization. */ class OsmPlacemark { public: enum OsmCategory { UnknownCategory, AccomodationCamping, AccomodationHostel, AccomodationHotel, AccomodationMotel, AccomodationYouthHostel, Address, AmenityLibrary, EducationCollege, EducationSchool, EducationUniversity, FoodBar, FoodBiergarten, FoodCafe, FoodFastFood, FoodPub, FoodRestaurant, HealthDoctors, HealthHospital, HealthPharmacy, MoneyAtm, MoneyBank, ShoppingBeverages, ShoppingHifi, ShoppingSupermarket, TouristAttraction, TouristCastle, TouristCinema, TouristMonument, TouristMuseum, TouristRuin, TouristTheatre, TouristThemePark, TouristViewPoint, TouristZoo, TransportAirport, TransportAirportTerminal, TransportAirportGate, TransportAirportRunway, + TransportAirportTaxiway, TransportBusStation, TransportBusStop, TransportCarShare, TransportFuel, TransportParking, TransportRentalBicycle, TransportRentalCar, TransportSpeedCamera, TransportTaxiRank, TransportTrainStation, TransportTramStop, PlacesRegion, PlacesCounty, PlacesCity, PlacesTown, PlacesVillage, PlacesHamlet, PlacesIsolatedDwelling, PlacesSuburb, PlacesLocality, PlacesIsland }; OsmPlacemark(); OsmCategory category() const; void setCategory( OsmCategory category ); /** Placemark name */ QString name() const; void setName( const QString &name ); /** Placemark's house number, if any */ QString houseNumber() const; void setHouseNumber( const QString &houseNumber ); /** Identifier of the smallest region containing this placemark, 0 if none (~main area). */ int regionId() const; void setRegionId( int id ); /** Regions' name */ QString additionalInformation() const; void setAdditionalInformation( const QString &name ); /** Longitude of the placemark's center point, in degree */ qreal longitude() const; void setLongitude( qreal longitude ); /** Latitude of the placemark's center point, in degree */ qreal latitude() const; void setLatitude( qreal latitude ); /** Placemarks are sorted by name by default */ bool operator<( const OsmPlacemark &other) const; bool operator==( const OsmPlacemark &other ) const; qreal matchScore( const DatabaseQuery* query ) const; private: int m_regionId; OsmCategory m_category; QString m_name; QString m_houseNumber; QString m_additionalInformation; qreal m_longitude; qreal m_latitude; }; } #endif // MARBLE_OSMPLACEMARK_H