summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-08-20 08:00:45 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-08-20 08:25:05 (GMT)
commit9bb72adddb37dc709e1804feec891bd4fdcb05a0 (patch)
treebe09801fb3ed143dc9dc523c54e34c4fac177e7f
parentff63d11da85af11795977c5154f9580f5ef0d534 (diff)
have OSM styling determine the visibility of OSM placemarks
-rw-r--r--src/lib/marble/osm/OsmPresetLibrary.cpp18
-rw-r--r--src/plugins/runner/osm/OsmRelation.cpp11
-rw-r--r--src/plugins/runner/osm/OsmWay.cpp15
3 files changed, 20 insertions, 24 deletions
diff --git a/src/lib/marble/osm/OsmPresetLibrary.cpp b/src/lib/marble/osm/OsmPresetLibrary.cpp
index 21b325d..2887123 100644
--- a/src/lib/marble/osm/OsmPresetLibrary.cpp
+++ b/src/lib/marble/osm/OsmPresetLibrary.cpp
@@ -400,6 +400,24 @@ QStringList OsmPresetLibrary::buildingValues()
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;
}
diff --git a/src/plugins/runner/osm/OsmRelation.cpp b/src/plugins/runner/osm/OsmRelation.cpp
index 1fe5735..392ae2f 100644
--- a/src/plugins/runner/osm/OsmRelation.cpp
+++ b/src/plugins/runner/osm/OsmRelation.cpp
@@ -54,8 +54,6 @@ void OsmRelation::create(GeoDataDocument *document, OsmWays &ways, const OsmNode
return;
}
- bool shouldRender = true;
-
QStringList const outerRoles = QStringList() << "outer" << "";
QSet<qint64> outerWays;
QSet<qint64> outerNodes;
@@ -75,9 +73,6 @@ void OsmRelation::create(GeoDataDocument *document, OsmWays &ways, const OsmNode
auto iterator = outerWays.begin();
GeoDataFeature::GeoDataVisualCategory const firstCategory =
OsmPresetLibrary::determineVisualCategory(ways[*iterator].osmData());
- if (ways[*iterator].osmData().containsTagKey("area:highway")) {
- shouldRender = false;
- }
for( ; iterator != outerWays.end(); ++iterator ) {
GeoDataFeature::GeoDataVisualCategory const category =
OsmPresetLibrary::determineVisualCategory(ways[*iterator].osmData());
@@ -102,15 +97,11 @@ void OsmRelation::create(GeoDataDocument *document, OsmWays &ways, const OsmNode
}
}
- if (osmData.containsTag("historic", "castle") && osmData.containsTag("castle_type", "kremlin")) {
- outerCategory = GeoDataFeature::None;
- }
-
GeoDataPlacemark* placemark = new GeoDataPlacemark;
placemark->setName(osmData.tagValue("name"));
placemark->setVisualCategory(outerCategory);
placemark->setStyle( GeoDataStyle::Ptr() );
- placemark->setVisible(shouldRender && outerCategory != GeoDataFeature::None);
+ placemark->setVisible(outerCategory != GeoDataFeature::None);
GeoDataPolygon* polygon = new GeoDataPolygon;
polygon->setOuterBoundary(outer[0]);
diff --git a/src/plugins/runner/osm/OsmWay.cpp b/src/plugins/runner/osm/OsmWay.cpp
index 5caf1cd..f81ad10 100644
--- a/src/plugins/runner/osm/OsmWay.cpp
+++ b/src/plugins/runner/osm/OsmWay.cpp
@@ -24,19 +24,6 @@ QSet<QString> OsmWay::s_areaTags;
void OsmWay::create(GeoDataDocument *document, const OsmNodes &nodes, QSet<qint64> &usedNodes) const
{
- bool const shouldRender =
- !m_osmData.containsTagKey("area:highway") && // Not supported yet
- !m_osmData.containsTag("boundary", "protected_area") && // Not relevant for the default map
- !m_osmData.containsTag("boundary", "postal_code") &&
- !m_osmData.containsTag("boundary", "aerial_views") && // Created by OSM editor(s) application for digitalization
- !m_osmData.containsTagKey("closed:highway") &&
- !m_osmData.containsTagKey("abandoned:highway") &&
- !m_osmData.containsTagKey("abandoned:natural") &&
- !m_osmData.containsTagKey("abandoned:building") &&
- !m_osmData.containsTagKey("abandoned:leisure") &&
- !m_osmData.containsTagKey("disused:highway") &&
- !m_osmData.containsTag("highway", "razed");
-
GeoDataPlacemark* placemark = new GeoDataPlacemark;
placemark->setOsmData(m_osmData);
placemark->setVisualCategory(OsmPresetLibrary::determineVisualCategory(m_osmData));
@@ -44,7 +31,7 @@ void OsmWay::create(GeoDataDocument *document, const OsmNodes &nodes, QSet<qint6
if (placemark->name().isEmpty() && placemark->visualCategory() >= GeoDataFeature::HighwaySteps && placemark->visualCategory() <= GeoDataFeature::HighwayMotorway) {
placemark->setName(m_osmData.tagValue("ref"));
}
- placemark->setVisible(shouldRender && placemark->visualCategory() != GeoDataFeature::None);
+ placemark->setVisible(placemark->visualCategory() != GeoDataFeature::None);
if (isArea()) {
GeoDataLinearRing* linearRing = new GeoDataLinearRing;