diff options
author | Mikhail Gorbushin <m.gorbushin@corp.mail.ru> | 2019-06-04 14:54:07 +0300 |
---|---|---|
committer | Maksim Andrianov <maksimandrianov1@gmail.com> | 2019-06-04 16:33:14 +0300 |
commit | 1179690d23f734101f9f9942acfa4b65b78e9314 (patch) | |
tree | 429b41de49a5f432249c96a70d053c4334310952 /generator | |
parent | 30f3ef890be81cc2b5bb63a6acce3a949df553bb (diff) |
[generator] fix RestrictionWriter
Diffstat (limited to 'generator')
-rw-r--r-- | generator/restriction_writer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/generator/restriction_writer.cpp b/generator/restriction_writer.cpp index 191cfcb3e4..2359ccbdeb 100644 --- a/generator/restriction_writer.cpp +++ b/generator/restriction_writer.cpp @@ -170,10 +170,13 @@ void RestrictionWriter::CollectRelation(RelationElement const & relationElement) GetType(relationElement, via.back().first) == OsmElement::EntityType::Node ? ViaType::Node : ViaType::Way; - m_stream << DebugPrint(type) << "," << DebugPrint(viaType) << ","; + auto const printHeader = [&]() { + m_stream << DebugPrint(type) << "," << DebugPrint(viaType) << ","; + }; if (viaType == ViaType::Way) { + printHeader(); m_stream << fromOsmId << ","; for (auto const & viaMember : via) m_stream << viaMember.first << ","; @@ -186,6 +189,7 @@ void RestrictionWriter::CollectRelation(RelationElement const & relationElement) if (!m_cache.GetNode(viaNodeOsmId, y, x)) return; + printHeader(); m_stream << x << "," << y << ","; m_stream << fromOsmId << ","; } |