summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-03 18:16:18 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-11-05 16:49:33 (GMT)
commit433547895e131acd7e6b5b113343bd92660a1620 (patch)
treeb96300f4bc0c35189fd44887f662859b8d8c8a2e
parent461dc1122bebbf5d7e5a84b4d03764e1eb1e6b75 (diff)
Only consider ways with non-local (positive) IDs
-rw-r--r--tools/vectorosm-tilecreator/WayConcatenator.cpp71
1 files changed, 36 insertions, 35 deletions
diff --git a/tools/vectorosm-tilecreator/WayConcatenator.cpp b/tools/vectorosm-tilecreator/WayConcatenator.cpp
index 336c94a..7a07d70 100644
--- a/tools/vectorosm-tilecreator/WayConcatenator.cpp
+++ b/tools/vectorosm-tilecreator/WayConcatenator.cpp
@@ -42,51 +42,52 @@ WayConcatenator::WayConcatenator(GeoDataDocument *document) :
osmData.containsTagKey("railway") ||
osmData.containsTagKey("waterway");
if (isWay) {
- ;
- ++m_originalWays;
GeoDataLineString *line = static_cast<GeoDataLineString*>(placemark->geometry());
qint64 firstId = osmData.nodeReference(line->first()).id();
Q_ASSERT(firstId != 0);
qint64 lastId = osmData.nodeReference(line->last()).id();
Q_ASSERT(lastId != 0);
+ if (firstId > 0 && lastId > 0) {
+ ++m_originalWays;
+ bool containsFirst = m_hash.contains(firstId);
+ bool containsLast = m_hash.contains(lastId);
- bool containsFirst = m_hash.contains(firstId);
- bool containsLast = m_hash.contains(lastId);
-
- if (!containsFirst && !containsLast) {
- createWayChunk(placemark, firstId, lastId);
- } else if (containsFirst && !containsLast) {
- WayChunk *chunk = wayChunk(placemark, firstId);
- if (chunk != nullptr) {
- concatFirst(placemark, chunk);
- } else {
- createWayChunk(placemark, firstId, lastId);
- }
- } else if (!containsFirst && containsLast) {
- WayChunk *chunk = wayChunk(placemark, lastId);
- if (chunk != nullptr) {
- concatLast(placemark, chunk);
- } else {
+ if (!containsFirst && !containsLast) {
createWayChunk(placemark, firstId, lastId);
- }
- } else if (containsFirst && containsLast) {
- WayChunk *chunk = wayChunk(placemark, firstId);
- WayChunk *otherChunk = wayChunk(placemark, lastId);
-
- if (chunk != nullptr && otherChunk != nullptr) {
- if(chunk == otherChunk) {
- m_wayPlacemarks.append(placemark);
+ } else if (containsFirst && !containsLast) {
+ WayChunk *chunk = wayChunk(placemark, firstId);
+ if (chunk != nullptr) {
+ concatFirst(placemark, chunk);
} else {
- concatBoth(placemark, chunk, otherChunk);
+ createWayChunk(placemark, firstId, lastId);
+ }
+ } else if (!containsFirst && containsLast) {
+ WayChunk *chunk = wayChunk(placemark, lastId);
+ if (chunk != nullptr) {
+ concatLast(placemark, chunk);
+ } else {
+ createWayChunk(placemark, firstId, lastId);
+ }
+ } else if (containsFirst && containsLast) {
+ WayChunk *chunk = wayChunk(placemark, firstId);
+ WayChunk *otherChunk = wayChunk(placemark, lastId);
+
+ if (chunk != nullptr && otherChunk != nullptr) {
+ if(chunk == otherChunk) {
+ m_wayPlacemarks.append(placemark);
+ } else {
+ concatBoth(placemark, chunk, otherChunk);
+ }
+ } else if(chunk != nullptr && otherChunk == nullptr) {
+ concatFirst(placemark, chunk);
+ } else if(chunk == nullptr && otherChunk != nullptr) {
+ concatLast(placemark, otherChunk);
+ } else {
+ createWayChunk(placemark, firstId, lastId);
}
- } else if(chunk != nullptr && otherChunk == nullptr) {
- concatFirst(placemark, chunk);
- } else if(chunk == nullptr && otherChunk != nullptr) {
- concatLast(placemark, otherChunk);
- } else {
- createWayChunk(placemark, firstId, lastId);
}
-
+ } else {
+ isWay = false;
}
}
}