summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-10-03 17:03:39 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-10-03 17:03:39 (GMT)
commitad0515bd2782e38e9560a02326dd9600b5285721 (patch)
treee822e7d3ef4bb30783137ffae4b351d6b8e4c6c4
parente64268225ea673555060cbc6aa725398aa5f430e (diff)
Keep nodes with tags
-rw-r--r--tools/vectorosm-tilecreator/NodeReducer.cpp2
-rw-r--r--tools/vectorosm-tilecreator/NodeReducer.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/tools/vectorosm-tilecreator/NodeReducer.cpp b/tools/vectorosm-tilecreator/NodeReducer.cpp
index b7d30cc..1c620e9 100644
--- a/tools/vectorosm-tilecreator/NodeReducer.cpp
+++ b/tools/vectorosm-tilecreator/NodeReducer.cpp
@@ -35,7 +35,7 @@ NodeReducer::NodeReducer(GeoDataDocument* document, int zoomLevel) :
if(geometry->nodeType() == GeoDataTypes::GeoDataLineStringType) {
GeoDataLineString const * prevLine = static_cast<GeoDataLineString const *>(geometry);
GeoDataLineString* reducedLine = new GeoDataLineString;
- reduce(prevLine, reducedLine);
+ reduce(prevLine, placemark->osmData(), reducedLine);
placemark->setGeometry(reducedLine);
}
diff --git a/tools/vectorosm-tilecreator/NodeReducer.h b/tools/vectorosm-tilecreator/NodeReducer.h
index 8689585..5569d2d 100644
--- a/tools/vectorosm-tilecreator/NodeReducer.h
+++ b/tools/vectorosm-tilecreator/NodeReducer.h
@@ -13,6 +13,7 @@
#include "BaseFilter.h"
#include "MarbleMath.h"
+#include "OsmPlacemarkData.h"
namespace Marble {
@@ -25,7 +26,7 @@ public:
private:
template<class T>
- void reduce(T const * lineString, T* reducedLine)
+ void reduce(T const * lineString, const OsmPlacemarkData &osmData, T* reducedLine)
{
qint64 const prevSize = lineString->size();
if (prevSize < 2) {
@@ -38,6 +39,9 @@ private:
reducedLine->append(*iter);
++iter;
for (auto const end = lineString->end() - 1; iter != end; ++iter) {
+ if (!osmData.nodeReference(currentCoords).isEmpty()) {
+ continue; // do not remove nodes with tags
+ }
if (distanceSphere( currentCoords, *iter ) >= m_resolution) {
currentCoords = *iter;
reducedLine->append(*iter);