From f7b43db64722883524084bd64de5a0f3cce68a9e Mon Sep 17 00:00:00 2001 From: Symmetricity <184246+Symmetricity@users.noreply.github.com> Date: Thu, 14 May 2026 08:38:20 +0200 Subject: [PATCH] Detect closed multipolygon ways The previous test compared begin() and end(), so it only treated empty way vectors as closed. Closed relation member rings then fell through the endpoint assembly path used for open fragments. That path is keyed by unordered endpoint containers, which can assemble otherwise complete rings in platform-dependent order before geometry correction and simplification. Checking the first and last coordinate keeps already-closed members in relation order and avoids unnecessary assembly work. --- src/osm_store.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osm_store.cpp b/src/osm_store.cpp index 5bd6ef61..799044d1 100644 --- a/src/osm_store.cpp +++ b/src/osm_store.cpp @@ -13,7 +13,7 @@ using namespace std; namespace bg = boost::geometry; static inline bool isClosed(const std::vector& way) { - return way.begin() == way.end(); + return !way.empty() && way.front() == way.back(); } UsedObjects::UsedObjects(Status status): status(status), mutex(256), ids(256 * 1024) {