Commit 93784bec authored by Volker Krause's avatar Volker Krause
Browse files

Fix geometry reassembly when we get both lines and areas for the same way

This can happen when a way-like element is also used in an area context,
e.g. as part of a multipolygon relation. The Marble tile generator in this
case duplicates the element, with one being clipped as a line and the other
one clipped as a polygon.

Attempting to merge lines and areas is futile and previously resulted in
an error with most parts being discarded. Now we only discard the way-like
bits, which allows us to reassemble the full geometry.
parent 3bc40d15
Pipeline #159776 passed with stages
in 3 minutes and 4 seconds
......@@ -207,8 +207,17 @@ void MarbleGeometryAssembler::mergeWay(OSM::Way &way, OSM::Way &otherWay) const
// - lines can only be merged at the beginning or the end, a line crossing the same boundary multiple times would be split at every boundary intersection
// - we can assume polygon orientation is preserved by the splitting
// in some cases the Marble tile generator produces both ways and areas for the same polygon
// e.g. for something way-like itself used in a multipolygon relations, with both being tagged
// we ignore the way in that case and rely solely on area merging
if (!way.isClosed() && !otherWay.isClosed()) {
mergeLine(way, otherWay);
} else if (way.isClosed() && !otherWay.isClosed()) {
return;
} else if (!way.isClosed() && otherWay.isClosed()) {
std::swap(way, otherWay);
return;
} else {
way.nodes = mergeArea(way, otherWay);
}
......
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