void changeset(const osmium::Changeset& changeset) {
                    write_prefix();
                    m_out += "<changeset";

                    oprintf(m_out, " id=\"%" PRId32 "\"", changeset.id());

                    if (changeset.created_at()) {
                        m_out += " created_at=\"";
                        m_out += changeset.created_at().to_iso();
                        m_out += "\"";
                    }

                    oprintf(m_out, " num_changes=\"%" PRId32 "\"", changeset.num_changes());

                    if (changeset.closed_at()) {
                        m_out += " closed_at=\"";
                        m_out += changeset.closed_at().to_iso();
                        m_out += "\" open=\"false\"";
                    } else {
                        m_out += " open=\"true\"";
                    }

                    if (changeset.bounds()) {
                        oprintf(m_out, " min_lon=\"%.7f\"", changeset.bounds().bottom_left().lon_without_check());
                        oprintf(m_out, " min_lat=\"%.7f\"", changeset.bounds().bottom_left().lat_without_check());
                        oprintf(m_out, " max_lon=\"%.7f\"", changeset.bounds().top_right().lon_without_check());
                        oprintf(m_out, " max_lat=\"%.7f\"", changeset.bounds().top_right().lat_without_check());
                    }

                    if (!changeset.user_is_anonymous()) {
                        m_out += " user=\"";
                        xml_string(m_out, changeset.user());
                        oprintf(m_out, "\" uid=\"%d\"", changeset.uid());
                    }

                    if (changeset.tags().empty()) {
                        m_out += "/>\n";
                        return;
                    }

                    m_out += ">\n";

                    write_tags(changeset.tags());

                    write_prefix();
                    m_out += "</changeset>\n";
                }
Beispiel #2
0
 void update(const osmium::Changeset& changeset) {
     update_int64(changeset.id());
     update(changeset.created_at());
     update(changeset.closed_at());
     update(changeset.bounds());
     update_int32(changeset.num_changes());
     update_int32(changeset.uid());
     update_string(changeset.user());
 }
Beispiel #3
0
            void changeset(const osmium::Changeset& changeset) {
                print_title("CHANGESET", changeset);
                *m_out << m_prefix
                       << "  id="
                       << changeset.id()
                       << "\n";
                *m_out << m_prefix
                       << "  num_changes="
                       << changeset.num_changes()
                       << "\n";
                *m_out << m_prefix
                       << "  uid="
                       << changeset.uid()
                       << "\n";
                *m_out << m_prefix
                       << "  user=|"
                       << changeset.user()
                       << "|\n";
                *m_out << m_prefix
                       << "  created_at="
                       << changeset.created_at().to_iso()
                       << "\n";
                *m_out << m_prefix
                       << "  closed_at="
                       << changeset.closed_at().to_iso()
                       << "\n";
                *m_out << m_prefix
                       << "  bounds=";

                if (changeset.bounds()) {
                    *m_out << '('
                           << changeset.bounds().bottom_left().lon_without_check()
                           << ','
                           << changeset.bounds().bottom_left().lat_without_check()
                           << ','
                           << changeset.bounds().top_right().lon_without_check()
                           << ','
                           << changeset.bounds().top_right().lat_without_check()
                           << ')';
                } else {
                    *m_out << "(undefined)";
                }

                *m_out << "\n";

                Dump dump(*m_out, m_with_size, m_prefix + "  ");
                osmium::apply(changeset.cbegin(), changeset.cend(), dump);
            }
 void changeset(const osmium::Changeset& changeset) {
     write_field_int('c', changeset.id());
     *m_out += ' ';
     write_field_int('k', changeset.num_changes());
     *m_out += ' ';
     write_field_timestamp('s', changeset.created_at());
     *m_out += ' ';
     write_field_timestamp('e', changeset.closed_at());
     *m_out += ' ';
     write_field_int('d', changeset.num_comments());
     *m_out += ' ';
     write_field_int('i', changeset.uid());
     *m_out += " u";
     append_encoded_string(changeset.user());
     write_location(changeset.bounds().bottom_left(), 'x', 'y');
     write_location(changeset.bounds().top_right(), 'X', 'Y');
     write_tags(changeset.tags());
     *m_out += '\n';
 }
                void changeset(const osmium::Changeset& changeset) {
                    output_formatted("c%d k%d s", changeset.id(), changeset.num_changes());
                    *m_out += changeset.created_at().to_iso();
                    *m_out += " e";
                    *m_out += changeset.closed_at().to_iso();
                    output_formatted(" d%d i%d u", changeset.num_comments(), changeset.uid());
                    append_encoded_string(changeset.user());
                    write_location(changeset.bounds().bottom_left(), 'x', 'y');
                    write_location(changeset.bounds().top_right(), 'X', 'Y');
                    *m_out += " T";
                    bool first = true;
                    for (const auto& tag : changeset.tags()) {
                        if (first) {
                            first = false;
                        } else {
                            *m_out += ',';
                        }
                        append_encoded_string(tag.key());
                        *m_out += '=';
                        append_encoded_string(tag.value());
                    }

                    *m_out += '\n';
                }