Skip to content

Commit 495d72e

Browse files
Remove original tag if value is split, fix test.
1 parent 22b8539 commit 495d72e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/osm/FactHandler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ void osm2ttl::osm::FactHandler<W>::writeTagList(
295295
const std::string& s, const osm2ttl::osm::TagList& tags) {
296296
size_t tagTripleCount = 0;
297297
for (const auto& tag : tags) {
298-
writeTag(s, tag);
299-
tagTripleCount++;
300298
const std::string& key = tag.first;
301299
std::string value = tag.second;
302300
// Special handling for ref tag splitting. Maybe generalize this...
@@ -313,6 +311,9 @@ void osm2ttl::osm::FactHandler<W>::writeTagList(
313311
std::string partialValue = value.substr(start, value.size());
314312
writeTag(s, osm2ttl::osm::Tag(key, partialValue));
315313
tagTripleCount++;
314+
} else {
315+
writeTag(s, tag);
316+
tagTripleCount++;
316317
}
317318
// Handling for wiki tags
318319
if (!_config.skipWikiLinks) {

tests/osm/FactHandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ TEST(OSM_FactHandler, writeTagListRefMultiple) {
10611061
config.output = "";
10621062
config.outputCompress = false;
10631063
config.mergeOutput = osm2ttl::util::OutputMergeMode::NONE;
1064+
config.semicolonTagKeys.insert("ref");
10641065

10651066
osm2ttl::util::Output output{config, config.output};
10661067
output.open();

0 commit comments

Comments
 (0)