Esempio n. 1
0
    // - walk over all relation-versions
    //   - walk over all bboxes
    //     - if the relation-id is recorded in the bboxes relation-tracker
    //       - send the relation to the bboxes writer
    void relation(const osmium::Relation& relation) {
        if (debug) {
            std::cerr << "softcut relation " << relation.positive_id() << " v" << relation.version() << "\n";
        }

        for (const auto& extract : info->extracts) {
            if (extract->relation_tracker.get(relation.positive_id())) {
                extract->write(relation);
            }
        }
    }
 void relation(const osmium::Relation& relation) {
     for (const auto& member : relation.members()) {
         switch (member.type()) {
             case osmium::item_type::node:
                 m_index_n2r.set(member.positive_ref(), relation.positive_id());
                 break;
             case osmium::item_type::way:
                 m_index_w2r.set(member.positive_ref(), relation.positive_id());
                 break;
             case osmium::item_type::relation:
                 m_index_r2r.set(member.positive_ref(), relation.positive_id());
                 break;
             default:
                 break;
         }
     }
 }
 void erelation(extract_data& e, const osmium::Relation& relation) {
     for (const auto& member : relation.members()) {
         switch (member.type()) {
             case osmium::item_type::node:
                 if (e.node_ids.get(member.positive_ref())) {
                     e.relation_ids.set(relation.positive_id());
                     return;
                 }
                 break;
             case osmium::item_type::way:
                 if (e.way_ids.get(member.positive_ref())) {
                     e.relation_ids.set(relation.positive_id());
                     return;
                 }
                 break;
             default:
                 break;
         }
     }
 }
Esempio n. 4
0
    // - walk over all relation-versions
    //   - walk over all bboxes
    //     - walk over all relation-members
    //       - if the relation-member is recorded in the bboxes node- or way-tracker
    //         - record its id in the bboxes relation-tracker
    void relation(const osmium::Relation& relation) {
        if (first_relation) {
            write_way_extra_nodes();
            first_relation = false;
        }

        if (debug) {
            std::cerr << "softcut relation " << relation.positive_id() << " v" << relation.version() << "\n";
        }

        for (const auto& extract : info->extracts) {
            bool hit = false;

            for (const auto& member : relation.members()) {

                if (!hit && (
                    (member.type() == osmium::item_type::node && extract->node_tracker.get(member.positive_ref())) ||
                    (member.type() == osmium::item_type::way && extract->way_tracker.get(member.positive_ref())) ||
                    (member.type() == osmium::item_type::relation && extract->relation_tracker.get(member.positive_ref()))
                )) {

                    if (debug) std::cerr << "relation has a member (" << member.type() << " " << member.positive_ref() << ") inside extract, recording in relation_tracker\n";
                    hit = true;

                    extract->relation_tracker.set(relation.positive_id());
                }

                if (member.type() == osmium::item_type::relation) {
                    if (debug) {
                        std::cerr << "recording cascading-pair: " << member.positive_ref() << " -> " << relation.positive_id() << "\n";
                    }
                    info->cascading_relations_tracker.insert(std::make_pair(member.positive_ref(), relation.positive_id()));
                }
            }

            if (hit) {
                cascading_relations(extract, relation.positive_id());
            }
        }
    }
Esempio n. 5
0
 void relation(const osmium::Relation& relation) {
     m_relation_index.set(relation.positive_id(), m_offset);
     m_offset += relation.byte_size();
 }
 void erelation(extract_data& e, const osmium::Relation& relation) {
     if (e.relation_ids.get(relation.positive_id())) {
         e.write(relation);
     }
 }