Edit

                    // Merge building addresses
                    for (size_t i = 0; i < local.building_addrs.size(); i++) {
                        auto& s = local.addr_strings[i];
                        auto sep = s.find('\0');
                        std::string hn = s.substr(0, sep);
                        std::string st = s.substr(sep + 1);
                        uint64_t dummy = 0;
                        add_addr_point(data, local.building_addrs[i].lat, local.building_addrs[i].lng,
                                       hn.c_str(), st.c_str(), dummy);
                    }

                    // Merge building addresses
                    for (size_t i = 0; i < local.building_addrs.size(); i++) {
                        uint64_t dummy = 0;
                        add_addr_point(data, local.building_addrs[i].lat, local.building_addrs[i].lng,
                                       local.addr_strings[i].first.c_str(),
                                       local.addr_strings[i].second.c_str(), dummy);
                    }