Commit 39fb2c30 authored by Dennis Nienhüser's avatar Dennis Nienhüser

Ensure .osm ways have equal first and last node ids for closed ways.

parent 1f0b61b1
......@@ -44,6 +44,16 @@ void OsmWayTagWriter::writeWay( const GeoDataLineString& lineString,
writer.writeEndElement();
}
if (!lineString.isEmpty() && lineString.isClosed()) {
auto const startId = osmData.nodeReference(lineString.first()).id();
auto const endId = osmData.nodeReference(lineString.last()).id();
if (startId != endId) {
writer.writeStartElement( osm::osmTag_nd );
writer.writeAttribute( "ref", QString::number(startId));
writer.writeEndElement();
}
}
writer.writeEndElement();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment