Now add the retry logic where assemble_outer_rings is called:


Edit

auto rings = assemble_outer_rings(rel.members, data.way_geometries);

                                auto rings = assemble_outer_rings(rel.members, data.way_geometries);
                                // If outer-only assembly failed, retry with all ways
                                // (inner ways can bridge gaps between outer ways)
                                if (rings.empty()) {
                                    rings = assemble_outer_rings(rel.members, data.way_geometries, true);
                                }