From cb230d8f26732139bfbc73bdd26c830cdd594849 Mon Sep 17 00:00:00 2001 From: dktue <2878623+dktue@users.noreply.github.com> Date: Thu, 29 Oct 2026 10:19:04 +0100 Subject: [PATCH] fix: keep small closed ways (roundabouts) that collapse when simplified (#315) --- src/tile_worker.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tile_worker.cpp b/src/tile_worker.cpp index 4f2f21d4..3b1537c5 100644 --- a/src/tile_worker.cpp +++ b/src/tile_worker.cpp @@ -149,6 +149,10 @@ void writeMultiLinestring( // buildings algorithm not supported for linestrings, so fall back to DP tmp.push_back(simplify(ls, simplifyLevel)); } + // A small closed way (e.g. a roundabout) can collapse to its start point, + // or to an out-and-back spike: keep it unsimplified instead + if (tmp.back().size() < 4 && ls.size() >= 4 && boost::geometry::equals(ls.front(), ls.back())) + tmp.back() = ls; } toWrite = &tmp; } else {