summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-14 21:06:25 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-11-14 21:06:25 (GMT)
commit49e66c96c371e46e4b9fec203a30dd0bc3c8bc08 (patch)
tree0c12c917905cf31705727f8dedad50e7ab782dee
parent32fda9a929bc839515047a1efde9a9260f1f50e9 (diff)
Only consider valid osm ids
-rw-r--r--tools/vectorosm-tilecreator/VectorClipper.cpp12
-rw-r--r--tools/vectorosm-tilecreator/VectorClipper.h4
2 files changed, 12 insertions, 4 deletions
diff --git a/tools/vectorosm-tilecreator/VectorClipper.cpp b/tools/vectorosm-tilecreator/VectorClipper.cpp
index f2a5c45..95199b7 100644
--- a/tools/vectorosm-tilecreator/VectorClipper.cpp
+++ b/tools/vectorosm-tilecreator/VectorClipper.cpp
@@ -460,10 +460,14 @@ void VectorClipper::clipPolygon(const GeoDataPlacemark *placemark, const Clipper
GeoDataPolygon* newPolygon = new GeoDataPolygon;
newPolygon->setOuterBoundary(outerRing);
newPlacemark->setGeometry(newPolygon);
- newPlacemarkOsmData.addTag(QStringLiteral("mx:oid"), QString::number(placemarkOsmData.id()));
+ if (placemarkOsmData.id() > 0) {
+ newPlacemarkOsmData.addTag(QStringLiteral("mx:oid"), QString::number(placemarkOsmData.id()));
+ }
copyTags(placemarkOsmData, newPlacemarkOsmData);
copyTags(outerRingOsmData, newOuterRingOsmData);
- newOuterRingOsmData.addTag(QStringLiteral("mx:oid"), QString::number(outerRingOsmData.id()));
+ if (outerRingOsmData.id() > 0) {
+ newOuterRingOsmData.addTag(QStringLiteral("mx:oid"), QString::number(outerRingOsmData.id()));
+ }
setBorderPoints(newOuterRingOsmData, borderPoints, outerRing.size());
auto const & innerBoundaries = polygon->innerBoundaries();
@@ -502,7 +506,9 @@ void VectorClipper::clipPolygon(const GeoDataPlacemark *placemark, const Clipper
++nodeIndex;
}
newPolygon->appendInnerBoundary(innerRing);
- newInnerRingOsmData.addTag(QStringLiteral("mx:oid"), QString::number(innerRingOsmData.id()));
+ if (innerRingOsmData.id() > 0) {
+ newInnerRingOsmData.addTag(QStringLiteral("mx:oid"), QString::number(innerRingOsmData.id()));
+ }
copyTags(innerRingOsmData, newInnerRingOsmData);
setBorderPoints(newInnerRingOsmData, borderPoints, innerRing.size());
}
diff --git a/tools/vectorosm-tilecreator/VectorClipper.h b/tools/vectorosm-tilecreator/VectorClipper.h
index c23ba2d..683e4aa 100644
--- a/tools/vectorosm-tilecreator/VectorClipper.h
+++ b/tools/vectorosm-tilecreator/VectorClipper.h
@@ -92,7 +92,9 @@ private:
}
newPlacemark->setGeometry(newRing);
- newPlacemark->osmData().addTag(QStringLiteral("mx:oid"), QString::number(placemark->osmData().id()));
+ if (placemark->osmData().id() > 0) {
+ newPlacemark->osmData().addTag(QStringLiteral("mx:oid"), QString::number(placemark->osmData().id()));
+ }
copyTags(*placemark, *newPlacemark);
setBorderPoints(newPlacemark->osmData(), borderPoints, newRing->size());
OsmObjectManager::initializeOsmData(newPlacemark);