Edit

// --- Parallel admin: assemble outer rings from collected way geometries ---

static std::vector<std::vector<std::pair<double,double>>> assemble_outer_rings(
    const std::vector<std::pair<int64_t, std::string>>& members,
    const std::unordered_map<int64_t, ParsedData::WayGeometry>& way_geoms,
    bool include_all_roles = false)

// --- Osmium-style segment-graph ring assembler ---
// Matches osmium's basic_assembler algorithm:
// 1. Decompose ways into segments (consecutive node pairs)
// 2. Sort segments, remove duplicates (shared boundaries cancel)
// 3. Build sorted location index for O(log n) segment lookup
// 4. Find split locations (nodes where 3+ segments meet)
// 5. Simple case: trace rings following segment chain
// 6. Complex case: build partial rings, then join open rings

static std::vector<std::vector<std::pair<double,double>>> assemble_outer_rings(
    const std::vector<std::pair<int64_t, std::string>>& members,
    const std::unordered_map<int64_t, ParsedData::WayGeometry>& way_geoms,
    bool include_all_roles = false)