summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-08-27 11:07:08 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-08-27 11:18:37 (GMT)
commit1ae9675bea36b120d2244f84cc737627e47e1f87 (patch)
tree5b005bf7e854df22ac86182db36afbfe5febd4a3
parent71e501c4b781f4c9ddcb901882355d220f4e4702 (diff)
Concentrate OSM styling in StyleBuilder by merging OsmPresetLibrary
-rw-r--r--src/lib/marble/EditPlacemarkDialog.cpp4
-rw-r--r--src/lib/marble/StyleBuilder.cpp433
-rw-r--r--src/lib/marble/StyleBuilder.h24
-rw-r--r--src/lib/marble/osm/CMakeLists.txt4
-rw-r--r--src/lib/marble/osm/OsmPresetLibrary.cpp441
-rw-r--r--src/lib/marble/osm/OsmPresetLibrary.h63
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget.cpp1
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.cpp10
-rw-r--r--src/lib/marble/osm/OsmTagEditorWidget_p.h9
-rw-r--r--src/plugins/render/annotate/EditPolygonDialog.cpp4
-rw-r--r--src/plugins/render/annotate/EditPolylineDialog.cpp4
-rw-r--r--src/plugins/runner/json/JsonParser.cpp5
-rw-r--r--src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp6
-rw-r--r--src/plugins/runner/osm/OsmNode.cpp4
-rw-r--r--src/plugins/runner/osm/OsmParser.cpp1
-rw-r--r--src/plugins/runner/osm/OsmRelation.cpp12
-rw-r--r--src/plugins/runner/osm/OsmWay.cpp6
17 files changed, 487 insertions, 544 deletions
diff --git a/src/lib/marble/EditPlacemarkDialog.cpp b/src/lib/marble/EditPlacemarkDialog.cpp
index 997fdf9..f1a639b 100644
--- a/src/lib/marble/EditPlacemarkDialog.cpp
+++ b/src/lib/marble/EditPlacemarkDialog.cpp
@@ -26,9 +26,9 @@
#include "MarbleWidget.h"
#include "MarbleLocale.h"
#include "FormattedTextWidget.h"
+#include "StyleBuilder.h"
#include "osm/OsmTagEditorWidget.h"
#include "osm/OsmPlacemarkData.h"
-#include "osm/OsmPresetLibrary.h"
#include "osm/OsmRelationManagerWidget.h"
namespace Marble {
@@ -341,7 +341,7 @@ void EditPlacemarkDialog::updateTextAnnotation()
}
else {
const OsmPlacemarkData osmData = d->m_osmTagEditorWidget->placemarkData();
- const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::determineVisualCategory(osmData);
+ const GeoDataFeature::GeoDataVisualCategory category = StyleBuilder::determineVisualCategory(osmData);
if (category != GeoDataFeature::None) {
d->m_placemark->setStyle(GeoDataStyle::Ptr());
d->m_placemark->setVisualCategory( category );
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index 42315b5..5d758c7 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -7,6 +7,7 @@
//
// Copyright 2007 Murad Tagirov <tmurad@gmail.com>
// Copyright 2009 Patrick Spendrin <ps_ml@gmx.de>
+// Copyright 2015 Marius-Valeriu Stanciu <stanciumarius94@gmail.com>
// Copyright 2016 Dennis Nienhüser <nienhueser@kde.org>
//
@@ -16,7 +17,6 @@
#include "OsmPlacemarkData.h"
#include "GeoDataTypes.h"
#include "GeoDataPlacemark.h"
-#include "OsmPresetLibrary.h"
#include <QApplication>
#include <QFont>
@@ -71,14 +71,23 @@ public:
static QString createPaintLayerItem(const QString &itemType, GeoDataFeature::GeoDataVisualCategory visualCategory, const QString &subType = QString());
+ static void initializeOsmVisualCategories();
+
int m_defaultMinZoomLevels[GeoDataFeature::LastIndex];
int m_maximumZoomLevel;
QColor m_defaultLabelColor;
QFont m_defaultFont;
GeoDataStyle::Ptr m_defaultStyle[GeoDataFeature::LastIndex];
bool m_defaultStyleInitialized;
+
+ /**
+ * @brief s_visualCategories contains osm tag mappings to GeoDataVisualCategories
+ */
+ static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory> s_visualCategories;
};
+QHash<StyleBuilder::OsmTag, GeoDataFeature::GeoDataVisualCategory> StyleBuilder::Private::s_visualCategories;
+
StyleBuilder::Private::Private() :
m_maximumZoomLevel(15),
m_defaultLabelColor(Qt::black),
@@ -828,6 +837,321 @@ QString StyleBuilder::Private::createPaintLayerItem(const QString &itemType, Geo
}
}
+void StyleBuilder::Private::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", "apron")] = GeoDataFeature::TransportAirportApron;
+ 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;
+ }
+}
StyleBuilder::StyleBuilder() :
d(new Private)
@@ -962,8 +1286,8 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
if (style->iconStyle().iconPath().isEmpty()) {
for (auto iter = osmData.tagsBegin(), end = osmData.tagsEnd(); iter != end; ++iter) {
- const auto tag = OsmPresetLibrary::OsmTag(iter.key(), iter.value());
- const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(tag);
+ const auto tag = OsmTag(iter.key(), iter.value());
+ const GeoDataFeature::GeoDataVisualCategory category = osmVisualCategory(tag);
const GeoDataStyle::ConstPtr categoryStyle = presetStyle(category);
if (category != GeoDataFeature::None && !categoryStyle->iconStyle().icon().isNull()) {
GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
@@ -1547,6 +1871,109 @@ QString StyleBuilder::visualCategoryName(GeoDataFeature::GeoDataVisualCategory c
return visualCategoryNames[category];
}
+GeoDataFeature::GeoDataVisualCategory StyleBuilder::osmVisualCategory(const StyleBuilder::OsmTag &tag)
+{
+ Private::initializeOsmVisualCategories();
+
+ return Private::s_visualCategories.value(tag, GeoDataFeature::None);
+}
+
+QHash<StyleBuilder::OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator StyleBuilder::begin()
+{
+ Private::initializeOsmVisualCategories();
+
+ return Private::s_visualCategories.constBegin();
+}
+
+QHash<StyleBuilder::OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator StyleBuilder::end()
+{
+ Private::initializeOsmVisualCategories();
+
+ return Private::s_visualCategories.constEnd();
+}
+
+QStringList StyleBuilder::shopValues()
+{
+ // from https://taginfo.openstreetmap.org/keys/building#values
+ static const 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 StyleBuilder::buildingValues()
+{
+ // from https://taginfo.openstreetmap.org/keys/building#values
+ static const 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 StyleBuilder::determineVisualCategory(const OsmPlacemarkData &osmData)
+{
+ if (osmData.containsTagKey("area:highway") || // Not supported yet
+ osmData.containsTag("boundary", "protected_area") || // Not relevant for the default map
+ osmData.containsTag("boundary", "postal_code") ||
+ osmData.containsTag("boundary", "aerial_views") || // Created by OSM editor(s) application for digitalization
+ osmData.containsTagKey("closed:highway") ||
+ osmData.containsTagKey("abandoned:highway") ||
+ osmData.containsTagKey("abandoned:natural") ||
+ osmData.containsTagKey("abandoned:building") ||
+ osmData.containsTagKey("abandoned:leisure") ||
+ osmData.containsTagKey("disused:highway") ||
+ osmData.containsTag("highway", "razed")) {
+ return GeoDataFeature::None;
+ }
+
+ if (osmData.containsTag("historic", "castle") && osmData.containsTag("castle_type", "kremlin")) {
+ return GeoDataFeature::None;
+ }
+
+ 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) {
+ const auto tag = OsmTag(iter.key(), iter.value());
+ GeoDataFeature::GeoDataVisualCategory category = osmVisualCategory(tag);
+ if (category != GeoDataFeature::None) {
+ return category;
+ }
+ }
+
+ return GeoDataFeature::None;
+}
+
StyleParameters::StyleParameters(const GeoDataFeature *feature_, int tileLevel_) :
feature(feature_),
tileLevel(tileLevel_)
diff --git a/src/lib/marble/StyleBuilder.h b/src/lib/marble/StyleBuilder.h
index d566a6f..3660b1a 100644
--- a/src/lib/marble/StyleBuilder.h
+++ b/src/lib/marble/StyleBuilder.h
@@ -12,9 +12,13 @@
#define MARBLE_STYLEBUILDER_H
#include <GeoDataStyle.h>
+#include "marble_export.h"
+
#include <GeoDataFeature.h>
+#include <GeoDataStyle.h>
-#include "marble_export.h"
+#include <QHash>
+#include <QPair>
class QFont;
class QColor;
@@ -34,6 +38,8 @@ public:
class MARBLE_EXPORT StyleBuilder
{
public:
+ typedef QPair<QString, QString> OsmTag;
+
StyleBuilder();
~StyleBuilder();
@@ -72,6 +78,22 @@ public:
static QString visualCategoryName(GeoDataFeature::GeoDataVisualCategory category);
+ /**
+ * @brief Convenience categorization of placemarks for Osm key=value pairs
+ */
+ static GeoDataFeature::GeoDataVisualCategory osmVisualCategory(const OsmTag &tag);
+
+ /**
+ * @brief begin and end provide an stl style iterator for the preset map
+ */
+ static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator begin();
+ static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator end();
+
+ static QStringList shopValues();
+ static QStringList buildingValues();
+
+ static GeoDataFeature::GeoDataVisualCategory determineVisualCategory(const OsmPlacemarkData &osmData);
+
private:
Q_DISABLE_COPY(StyleBuilder)
diff --git a/src/lib/marble/osm/CMakeLists.txt b/src/lib/marble/osm/CMakeLists.txt
index 620e047..ee0f7e0 100644
--- a/src/lib/marble/osm/CMakeLists.txt
+++ b/src/lib/marble/osm/CMakeLists.txt
@@ -1,6 +1,5 @@
set( osm_HDRS
OsmPlacemarkData.h
- OsmPresetLibrary.h
OsmObjectManager.h
OsmTagEditorWidget.h
OsmRelationEditorDialog.h
@@ -9,7 +8,6 @@ set( osm_HDRS
set( osm_SRCS
osm/OsmPlacemarkData.cpp
- osm/OsmPresetLibrary.cpp
osm/OsmObjectManager.cpp
osm/OsmTagEditorWidget.cpp
osm/OsmTagEditorWidget_p.cpp
@@ -21,4 +19,4 @@ set( osm_SRCS
set( osm_UIS
osm/OsmTagEditorWidget.ui
osm/OsmRelationManagerWidget.ui
-) \ No newline at end of file
+)
diff --git a/src/lib/marble/osm/OsmPresetLibrary.cpp b/src/lib/marble/osm/OsmPresetLibrary.cpp
deleted file mode 100644
index 6d7031c..0000000
--- a/src/lib/marble/osm/OsmPresetLibrary.cpp
+++ /dev/null
@@ -1,441 +0,0 @@
-//
-// 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 <stanciumarius94@gmail.com>
-//
-
-#include "OsmPresetLibrary.h"
-
-#include "GeoDataTypes.h"
-#include "GeoDataFeature.h"
-#include "GeoDataPlacemark.h"
-#include "GeoDataStyle.h"
-#include "OsmPlacemarkData.h"
-
-namespace Marble
-{
-
-QHash<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory> OsmPresetLibrary::s_visualCategories;
-
-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", "apron" ) ] = GeoDataFeature::TransportAirportApron;
- 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;
- }
-}
-
-GeoDataFeature::GeoDataVisualCategory OsmPresetLibrary::osmVisualCategory(const OsmTag &tag)
-{
- initializeOsmVisualCategories();
-
- return s_visualCategories.value(tag, GeoDataFeature::None);
-}
-
-QHash<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator OsmPresetLibrary::begin()
-{
- initializeOsmVisualCategories();
- return s_visualCategories.constBegin();
-}
-
-QHash<OsmPresetLibrary::OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator OsmPresetLibrary::end()
-{
- initializeOsmVisualCategories();
- return s_visualCategories.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("area:highway") || // Not supported yet
- osmData.containsTag("boundary", "protected_area") || // Not relevant for the default map
- osmData.containsTag("boundary", "postal_code") ||
- osmData.containsTag("boundary", "aerial_views") || // Created by OSM editor(s) application for digitalization
- osmData.containsTagKey("closed:highway") ||
- osmData.containsTagKey("abandoned:highway") ||
- osmData.containsTagKey("abandoned:natural") ||
- osmData.containsTagKey("abandoned:building") ||
- osmData.containsTagKey("abandoned:leisure") ||
- osmData.containsTagKey("disused:highway") ||
- osmData.containsTag("highway", "razed")) {
- return GeoDataFeature::None;
- }
-
- if (osmData.containsTag("historic", "castle") && osmData.containsTag("castle_type", "kremlin")) {
- return GeoDataFeature::None;
- }
-
- 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) {
- const auto tag = OsmPresetLibrary::OsmTag(iter.key(), iter.value());
- GeoDataFeature::GeoDataVisualCategory category = osmVisualCategory(tag);
- if (category != GeoDataFeature::None) {
- return category;
- }
- }
-
-
- return GeoDataFeature::None;
-}
-
-}
diff --git a/src/lib/marble/osm/OsmPresetLibrary.h b/src/lib/marble/osm/OsmPresetLibrary.h
deleted file mode 100644
index 42d56b3..0000000
--- a/src/lib/marble/osm/OsmPresetLibrary.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// 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 <stanciumarius94@gmail.com>
-//
-
-#ifndef MARBLE_OSMPRESETLIBRARY_H
-#define MARBLE_OSMPRESETLIBRARY_H
-
-#include <QHash>
-#include <QPair>
-
-#include "GeoDataFeature.h"
-#include "marble_export.h"
-
-namespace Marble
-{
-class GeoDataPlacemark;
-class OsmPlacemarkData;
-
-/**
- * @brief The OsmPresetLibrary class centralizes osm tag presets
- */
-class MARBLE_EXPORT OsmPresetLibrary
-{
-
-public:
- typedef QPair<QString, QString> OsmTag;
-
- /**
- * @brief Convenience categorization of placemarks for Osm key=value pairs
- */
- static GeoDataFeature::GeoDataVisualCategory osmVisualCategory(const OsmTag &tag);
-
- /**
- * @brief begin and end provide an stl style iterator for the preset map
- */
- static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator begin();
- static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator end();
-
- static QStringList shopValues();
- static QStringList buildingValues();
-
- static GeoDataFeature::GeoDataVisualCategory determineVisualCategory(const OsmPlacemarkData &osmData);
-
-private:
- static void initializeOsmVisualCategories();
-
- /**
- * @brief s_visualCategories contains osm tag mappings to GeoDataVisualCategories
- */
- static QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory> s_visualCategories;
-};
-
-
-
-}
-
-#endif
diff --git a/src/lib/marble/osm/OsmTagEditorWidget.cpp b/src/lib/marble/osm/OsmTagEditorWidget.cpp
index d5a7e56..e3786da 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget.cpp
@@ -23,7 +23,6 @@
#include "GeoDataPlacemark.h"
#include "GeoDataGeometry.h"
#include "OsmPlacemarkData.h"
-#include "OsmPresetLibrary.h"
namespace Marble
{
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
index 5d1cd25..4cb673d 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.cpp
@@ -68,7 +68,7 @@ void OsmTagEditorWidgetPrivate::populateCurrentTagsList()
QHash< QString, QString>::const_iterator it = osmData.tagsBegin();
QHash< QString, QString>::const_iterator end = osmData.tagsEnd();
for ( ; it != end; ++it ) {
- QTreeWidgetItem *tagItem = tagWidgetItem( OsmPresetLibrary::OsmTag( it.key(), it.value() ) );
+ QTreeWidgetItem *tagItem = tagWidgetItem(OsmTag(it.key(), it.value()));
m_currentTagsList->addTopLevelItem( tagItem );
}
}
@@ -89,7 +89,7 @@ void OsmTagEditorWidgetPrivate::populateCurrentTagsList()
void OsmTagEditorWidgetPrivate::populatePresetTagsList()
{
QList<OsmTag> tags = recommendedTags();
- foreach ( const OsmPresetLibrary::OsmTag &tag, tags ) {
+ foreach (const OsmTag &tag, tags) {
QTreeWidgetItem *tagItem = tagWidgetItem( tag );
m_recommendedTagsList->addTopLevelItem( tagItem );
}
@@ -107,7 +107,7 @@ QTreeWidgetItem *OsmTagEditorWidgetPrivate::tagWidgetItem( const OsmTag &tag ) c
QTreeWidgetItem *tagItem = new QTreeWidgetItem( itemText );
// Getting the icon preset for the tag ( if there's one available )
- const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(tag);
+ const GeoDataFeature::GeoDataVisualCategory category = StyleBuilder::osmVisualCategory(tag);
GeoDataStyle::ConstPtr style = styleBuilder.presetStyle(category);
QPixmap iconPixmap = QPixmap::fromImage( style->iconStyle().icon() );
tagItem->setIcon( 1, QIcon( iconPixmap ) );
@@ -123,8 +123,8 @@ QList<OsmTagEditorWidgetPrivate::OsmTag> OsmTagEditorWidgetPrivate::recommendedT
QStringList filter = generateTagFilter();
- QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator it = OsmPresetLibrary::begin();
- QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator end = OsmPresetLibrary::end();
+ QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator it = StyleBuilder::begin();
+ QHash<OsmTag, GeoDataFeature::GeoDataVisualCategory>::const_iterator end = StyleBuilder::end();
for ( ; it != end; ++it ) {
if ( filter.contains( it.key().first ) ) {
diff --git a/src/lib/marble/osm/OsmTagEditorWidget_p.h b/src/lib/marble/osm/OsmTagEditorWidget_p.h
index 33b8c06..41d867a 100644
--- a/src/lib/marble/osm/OsmTagEditorWidget_p.h
+++ b/src/lib/marble/osm/OsmTagEditorWidget_p.h
@@ -12,17 +12,20 @@
#define MARBLE_OSMTAGEDITORWIDGETPRIVATE_H
#include "ui_OsmTagEditorWidget.h"
-#include "osm/OsmPresetLibrary.h"
+
+#include <QPair>
namespace Marble
{
-class OsmTagEditorWidget;
+class GeoDataPlacemark;
+class OsmPlacemarkData;
+class OsmTagEditorWidget;
class OsmTagEditorWidgetPrivate : public Ui::OsmTagEditorWidgetPrivate
{
public:
- typedef OsmPresetLibrary::OsmTag OsmTag;
+ typedef QPair<QString, QString> OsmTag;
OsmTagEditorWidgetPrivate();
~OsmTagEditorWidgetPrivate();
void populatePresetTagsList();
diff --git a/src/plugins/render/annotate/EditPolygonDialog.cpp b/src/plugins/render/annotate/EditPolygonDialog.cpp
index 8e77b7f..6135a71 100644
--- a/src/plugins/render/annotate/EditPolygonDialog.cpp
+++ b/src/plugins/render/annotate/EditPolygonDialog.cpp
@@ -22,8 +22,8 @@
#include "NodeModel.h"
#include "NodeItemDelegate.h"
#include "FormattedTextWidget.h"
+#include "StyleBuilder.h"
#include "osm/OsmTagEditorWidget.h"
-#include "osm/OsmPresetLibrary.h"
#include "osm/OsmPlacemarkData.h"
#include "osm/OsmRelationManagerWidget.h"
@@ -256,7 +256,7 @@ void EditPolygonDialog::updatePolygon()
// If there is not custom style initialized( default #polyline url is used ) and there is a osmTag-based style
// available, set it
const OsmPlacemarkData osmData = d->m_osmTagEditorWidget->placemarkData();
- const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::determineVisualCategory(osmData);
+ const GeoDataFeature::GeoDataVisualCategory category = StyleBuilder::determineVisualCategory(osmData);
if (d->m_placemark->styleUrl() == QLatin1String("#polygon") && category != GeoDataFeature::None) {
d->m_placemark->setStyle( GeoDataStyle::Ptr() ); // first clear style so style gets set by setVisualCategory()
d->m_placemark->setVisualCategory( category );
diff --git a/src/plugins/render/annotate/EditPolylineDialog.cpp b/src/plugins/render/annotate/EditPolylineDialog.cpp
index fe58b80..a4252ce 100644
--- a/src/plugins/render/annotate/EditPolylineDialog.cpp
+++ b/src/plugins/render/annotate/EditPolylineDialog.cpp
@@ -23,8 +23,8 @@
#include "NodeModel.h"
#include "FormattedTextWidget.h"
#include "NodeItemDelegate.h"
+#include "StyleBuilder.h"
#include "osm/OsmTagEditorWidget.h"
-#include "osm/OsmPresetLibrary.h"
#include "osm/OsmPlacemarkData.h"
#include "osm/OsmRelationManagerWidget.h"
@@ -220,7 +220,7 @@ void EditPolylineDialog::updatePolyline()
// If there is no custom style initialized( default #polyline url is used ) and there is a osmTag-based style
// available, set it
const OsmPlacemarkData osmData = d->m_osmTagEditorWidget->placemarkData();
- const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::determineVisualCategory(osmData);
+ const GeoDataFeature::GeoDataVisualCategory category = StyleBuilder::determineVisualCategory(osmData);
if (d->m_placemark->styleUrl() == QLatin1String("#polyline") && category != GeoDataFeature::None) {
d->m_placemark->setStyle( GeoDataStyle::Ptr() ); // first clear style so style gets set by setVisualCategory()
d->m_placemark->setVisualCategory( category );
diff --git a/src/plugins/runner/json/JsonParser.cpp b/src/plugins/runner/json/JsonParser.cpp
index 6d48028..0ffad46 100644
--- a/src/plugins/runner/json/JsonParser.cpp
+++ b/src/plugins/runner/json/JsonParser.cpp
@@ -12,9 +12,8 @@
#include "GeoDataDocument.h"
#include "GeoDataPlacemark.h"
#include "GeoDataPolygon.h"
-#include "osm/OsmPresetLibrary.h"
-
#include "MarbleDebug.h"
+#include "StyleBuilder.h"
#include "osm/OsmPlacemarkData.h"
#include <QIODevice>
@@ -266,7 +265,7 @@ bool JsonParser::read( QIODevice* device )
}
}
- const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::determineVisualCategory(osmData);
+ const GeoDataFeature::GeoDataVisualCategory category = StyleBuilder::determineVisualCategory(osmData);
if (category != GeoDataFeature::None) {
// Add the visual category to all the placemarks
for (int pl = 0 ; pl < placemarkList.length(); ++pl) {
diff --git a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
index 1147856..3f4f31b 100644
--- a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
+++ b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
@@ -16,7 +16,7 @@
#include "GeoDataPlacemark.h"
#include "GeoDataExtendedData.h"
#include "HttpDownloadManager.h"
-#include "osm/OsmPresetLibrary.h"
+#include "StyleBuilder.h"
#include "osm/OsmPlacemarkData.h"
#include <QString>
@@ -203,8 +203,8 @@ void OsmNominatimRunner::handleResult( QNetworkReply* reply )
placemark->setDescription(description);
placemark->setAddress(desc);
placemark->setCoordinate( lon.toDouble(), lat.toDouble(), 0, GeoDataCoordinates::Degree );
- const auto tag = OsmPresetLibrary::OsmTag(key, value);
- const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(tag);
+ const auto tag = StyleBuilder::OsmTag(key, value);
+ const GeoDataFeature::GeoDataVisualCategory category = StyleBuilder::osmVisualCategory(tag);
placemark->setVisualCategory( category );
placemark->setExtendedData(placemarkData);
placemark->setOsmData(data);
diff --git a/src/plugins/runner/osm/OsmNode.cpp b/src/plugins/runner/osm/OsmNode.cpp
index 50858dc..b9ca66a 100644
--- a/src/plugins/runner/osm/OsmNode.cpp
+++ b/src/plugins/runner/osm/OsmNode.cpp
@@ -10,12 +10,12 @@
#include <OsmNode.h>
-#include "osm/OsmPresetLibrary.h"
#include "osm/OsmObjectManager.h"
#include <GeoDataPlacemark.h>
#include <GeoDataStyle.h>
#include <GeoDataIconStyle.h>
#include <MarbleDirs.h>
+#include <StyleBuilder.h>
#include <QXmlStreamAttributes>
@@ -35,7 +35,7 @@ void OsmNode::setCoordinates(const GeoDataCoordinates &coordinates)
void OsmNode::create(GeoDataDocument *document) const
{
- GeoDataFeature::GeoDataVisualCategory const category = OsmPresetLibrary::determineVisualCategory(m_osmData);
+ GeoDataFeature::GeoDataVisualCategory const category = StyleBuilder::determineVisualCategory(m_osmData);
if (category == GeoDataFeature::None) {
return;
diff --git a/src/plugins/runner/osm/OsmParser.cpp b/src/plugins/runner/osm/OsmParser.cpp
index 0aad036..99f062b 100644
--- a/src/plugins/runner/osm/OsmParser.cpp
+++ b/src/plugins/runner/osm/OsmParser.cpp
@@ -13,7 +13,6 @@
#include "OsmParser.h"
#include "OsmElementDictionary.h"
-#include "osm/OsmPresetLibrary.h"
#include "osm/OsmObjectManager.h"
#include "GeoDataDocument.h"
#include "GeoDataPlacemark.h"
diff --git a/src/plugins/runner/osm/OsmRelation.cpp b/src/plugins/runner/osm/OsmRelation.cpp
index a4cfb25..f786946 100644
--- a/src/plugins/runner/osm/OsmRelation.cpp
+++ b/src/plugins/runner/osm/OsmRelation.cpp
@@ -11,7 +11,7 @@
#include <OsmRelation.h>
#include <MarbleDebug.h>
#include <GeoDataPlacemark.h>
-#include <osm/OsmPresetLibrary.h>
+#include <StyleBuilder.h>
#include <osm/OsmObjectManager.h>
namespace Marble {
@@ -69,17 +69,17 @@ void OsmRelation::create(GeoDataDocument *document, OsmWays &ways, const OsmNode
return;
}
- GeoDataFeature::GeoDataVisualCategory outerCategory = OsmPresetLibrary::determineVisualCategory(m_osmData);
+ GeoDataFeature::GeoDataVisualCategory outerCategory = StyleBuilder::determineVisualCategory(m_osmData);
if (outerCategory == GeoDataFeature::None) {
// Try to determine the visual category from the relation members
auto iterator = outerWays.begin();
GeoDataFeature::GeoDataVisualCategory const firstCategory =
- OsmPresetLibrary::determineVisualCategory(ways[*iterator].osmData());
+ StyleBuilder::determineVisualCategory(ways[*iterator].osmData());
bool categoriesAreSame = true;
for( ; iterator != outerWays.end(); ++iterator ) {
GeoDataFeature::GeoDataVisualCategory const category =
- OsmPresetLibrary::determineVisualCategory(ways[*iterator].osmData());
+ StyleBuilder::determineVisualCategory(ways[*iterator].osmData());
if( category != firstCategory ) {
categoriesAreSame = false;
break;
@@ -93,7 +93,7 @@ void OsmRelation::create(GeoDataDocument *document, OsmWays &ways, const OsmNode
foreach(qint64 wayId, outerWays) {
Q_ASSERT(ways.contains(wayId));
- GeoDataFeature::GeoDataVisualCategory const category = OsmPresetLibrary::determineVisualCategory(ways[wayId].osmData());
+ GeoDataFeature::GeoDataVisualCategory const category = StyleBuilder::determineVisualCategory(ways[wayId].osmData());
if (category == GeoDataFeature::None || category == outerCategory) {
// Schedule way for removal: It's a non-styled way only used to create the outer boundary in this polygon
usedWays << wayId;
@@ -113,7 +113,7 @@ void OsmRelation::create(GeoDataDocument *document, OsmWays &ways, const OsmNode
int index = 0;
foreach(qint64 wayId, innerWays) {
Q_ASSERT(ways.contains(wayId));
- if (OsmPresetLibrary::determineVisualCategory(ways[wayId].osmData()) == GeoDataFeature::None) {
+ if (StyleBuilder::determineVisualCategory(ways[wayId].osmData()) == GeoDataFeature::None) {
// Schedule way for removal: It's a non-styled way only used to create the inner boundary in this polygon
usedWays << wayId;
}
diff --git a/src/plugins/runner/osm/OsmWay.cpp b/src/plugins/runner/osm/OsmWay.cpp
index a5f081d..30a97d4 100644
--- a/src/plugins/runner/osm/OsmWay.cpp
+++ b/src/plugins/runner/osm/OsmWay.cpp
@@ -14,9 +14,9 @@
#include <GeoDataLineStyle.h>
#include <GeoDataPolyStyle.h>
#include <GeoDataStyle.h>
-#include <osm/OsmPresetLibrary.h>
#include <osm/OsmObjectManager.h>
#include <MarbleDirs.h>
+#include <StyleBuilder.h>
namespace Marble {
@@ -26,7 +26,7 @@ void OsmWay::create(GeoDataDocument *document, const OsmNodes &nodes, QSet<qint6
{
GeoDataPlacemark* placemark = new GeoDataPlacemark;
placemark->setOsmData(m_osmData);
- placemark->setVisualCategory(OsmPresetLibrary::determineVisualCategory(m_osmData));
+ placemark->setVisualCategory(StyleBuilder::determineVisualCategory(m_osmData));
placemark->setName(m_osmData.tagValue("name"));
if (placemark->name().isEmpty() && placemark->visualCategory() >= GeoDataFeature::HighwaySteps && placemark->visualCategory() <= GeoDataFeature::HighwayMotorway) {
placemark->setName(m_osmData.tagValue("ref"));
@@ -141,7 +141,7 @@ bool OsmWay::isAreaTag(const QString &keyValue)
s_areaTags.insert( "area=yes" );
s_areaTags.insert( "waterway=riverbank" );
- foreach(const QString &value, OsmPresetLibrary::buildingValues() ) {
+ foreach(const QString &value, StyleBuilder::buildingValues() ) {
s_areaTags.insert(QLatin1String("building=") + value);
}
s_areaTags.insert( "man_made=bridge" );