summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-07-24 17:36:43 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-07-24 17:36:43 (GMT)
commitf9efd262efff5390012788fc8bbf9e5f4319e001 (patch)
treee83261778f81c1fa1259862d611b37196ed6eebb
parent32c48f393b2ccd412295b612dc7b02966ebe3635 (diff)
When a highway has no name, use ref instead
OSM Wiki: "used for reference numbers or codes. Common for roads, highway exits, routes, etc."
-rw-r--r--src/plugins/runner/osm/OsmWay.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/runner/osm/OsmWay.cpp b/src/plugins/runner/osm/OsmWay.cpp
index 0904458..5caf1cd 100644
--- a/src/plugins/runner/osm/OsmWay.cpp
+++ b/src/plugins/runner/osm/OsmWay.cpp
@@ -41,6 +41,9 @@ void OsmWay::create(GeoDataDocument *document, const OsmNodes &nodes, QSet<qint6
placemark->setOsmData(m_osmData);
placemark->setVisualCategory(OsmPresetLibrary::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"));
+ }
placemark->setVisible(shouldRender && placemark->visualCategory() != GeoDataFeature::None);
if (isArea()) {