本文整理汇总了C++中osmium::Relation::version方法的典型用法代码示例。如果您正苦于以下问题:C++ Relation::version方法的具体用法?C++ Relation::version怎么用?C++ Relation::version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osmium::Relation
的用法示例。
在下文中一共展示了Relation::version方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: relation
void relation(const osmium::Relation& relation) {
if (m_write_change_ops) {
open_close_op_tag(relation.visible() ? (relation.version() == 1 ? operation::op_create : operation::op_modify) : operation::op_delete);
}
write_prefix();
m_out += "<relation";
write_meta(relation);
if (relation.tags().empty() && relation.members().empty()) {
m_out += "/>\n";
return;
}
m_out += ">\n";
for (const auto& member : relation.members()) {
write_prefix();
m_out += " <member type=\"";
m_out += item_type_to_name(member.type());
oprintf(m_out, "\" ref=\"%" PRId64 "\" role=\"", member.ref());
xml_string(m_out, member.role());
m_out += "\"/>\n";
}
write_tags(relation.tags());
write_prefix();
m_out += "</relation>\n";
}
示例2: relation
// - walk over all relations-versions
// - walk over all relations-nodes
// - Adds the nodes and ways that aren't in node-tracker to a vector
// - if node or way is in the box hit becames true
// - if hit is true and the vector is not empty (it means their are nodes or ways that belong to a relation that has at least one node or way inside the box)
// - Records the id of node or way to outside_node_tracker or outside_way_tracker
void relation(const osmium::Relation& relation) {
bool hit = false;
if (debug) {
std::cerr << "cut_administrative relation " << relation.id() << " v" << relation.version() << "\n";
}
std::vector<const osmium::RelationMember*> members;
std::vector<const osmium::TagList*> tags;
for (auto& tag : relation.tags()) {
if (strcmp(tag.key(), "boundary") == 0 && strcmp(tag.value(), "administrative") == 0)
hit = true;
}
for (const auto& extract : info->extracts) {
if (hit){
if(!extract->relation_tracker.get(relation.id())){
extract->relation_tracker.set(relation.id());
}
//Add only the nodes and ways that were not yet in the respective trackers if hit is true
for (const auto& member : relation.members()) {
if (member.type() == osmium::item_type::way && !extract->way_tracker.get(member.ref())){
extract->way_tracker.set(member.ref());
}
}
}
}
}
示例3: relation
// - 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);
}
}
}
示例4: relation
void relation(const osmium::Relation& rel) {
++rels;
if (!matches_user_filter(rel)) return;
++urels;
if (rel.visible()==false) {
m_relfile <<
rel.id() << "\t" <<
rel.version() << "\t" <<
rel.changeset() << "\t" <<
rel.timestamp().to_iso() << "\t" <<
rel.uid() << std::endl;
}
}