当前位置: 首页>>代码示例>>C++>>正文


C++ osmium::Node类代码示例

本文整理汇总了C++中osmium::Node的典型用法代码示例。如果您正苦于以下问题:C++ Node类的具体用法?C++ Node怎么用?C++ Node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Node类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: node

    void node(const osmium::Node& node) {
        const char* label = node.tags().get_value_by_key("label");
        if (label) {
            OGRFeature* feature = OGRFeature::CreateFeature(m_layer_labels->GetLayerDefn());
            std::unique_ptr<OGRPoint> ogr_point = m_factory.create_point(node);
            feature->SetGeometry(ogr_point.get());
            feature->SetField("id", static_cast<double>(node.id()));
            feature->SetField("label", label);

            if (m_layer_labels->CreateFeature(feature) != OGRERR_NONE) {
                std::cerr << "Failed to create feature.\n";
                exit(1);
            }

            OGRFeature::DestroyFeature(feature);
        } else {
            OGRFeature* feature = OGRFeature::CreateFeature(m_layer_nodes->GetLayerDefn());
            std::unique_ptr<OGRPoint> ogr_point = m_factory.create_point(node);
            feature->SetGeometry(ogr_point.get());
            feature->SetField("id", static_cast<double>(node.id()));

            if (m_layer_nodes->CreateFeature(feature) != OGRERR_NONE) {
                std::cerr << "Failed to create feature.\n";
                exit(1);
            }
            OGRFeature::DestroyFeature(feature);
        }
    }
开发者ID:7890,项目名称:osrm-backend,代码行数:28,代码来源:testdata-overview.cpp

示例2: node

 void node(const osmium::Node& node) {
     if (m_cfg.add_untagged_nodes || !node.tags().empty()) {
         gdalcpp::Feature feature{m_layer_point, m_factory.create_point(node)};
         feature.set_field("id", double(node.id()));
         add_feature(feature, node);
     }
 }
开发者ID:osmcode,项目名称:osm-gis-export,代码行数:7,代码来源:osm_gis_export_overview.cpp

示例3: node

	void node( osmium::Node& node ) {
		const char* value= node.tags().get_value_by_key("highway");
		const char* name = node.tags().get_value_by_key("name");
		if(name && value && !strcmp(value, "bus_stop")){
			map[node.positive_id()] = name;
		}
		
	}
开发者ID:djjoe,项目名称:University-projects,代码行数:8,代码来源:malvin.cpp

示例4: create_point

 point_type create_point(const osmium::Node& node) {
     try {
         return create_point(node.location());
     } catch (osmium::geometry_error& e) {
         e.set_id("node", node.id());
         throw;
     }
 }
开发者ID:hydrays,项目名称:osrm-backend,代码行数:8,代码来源:factory.hpp

示例5: node

 void node(osmium::Node &n) {
     // no nodes in the history file have a zero location, and
     // no visible nodes should have an undefined location.
     if ((n.location() == zero) ||
         (n.visible() && !n.location())) {
         ++count;
     }
     ++total_count;
 }
开发者ID:knowname,项目名称:libosmium,代码行数:9,代码来源:test_reader.cpp

示例6: node

 void node(const osmium::Node& node) {
     // Getting a tag value can be expensive, because a list of tags has
     // to be gone through and each tag has to be checked. So we store the
     // result and reuse it.
     const char* amenity = node.tags()["amenity"];
     if (amenity) {
         print_amenity(amenity, node.tags()["name"], node.location());
     }
 }
开发者ID:daniel-j-h,项目名称:libosmium,代码行数:9,代码来源:osmium_amenity_list.cpp

示例7: node

 void node(const osmium::Node& node) {
     const char* amenity = node.tags().get_value_by_key("amenity");
     if (amenity && !strcmp(amenity, "pub")) {
         const char* name = node.tags().get_value_by_key("name");
         if (name) {
             std::cout << name << std::endl;
         }
     }
 }
开发者ID:rnorris,项目名称:osmium-contrib,代码行数:9,代码来源:pub_names.cpp

示例8: node

 void node(const osmium::Node& node) {
     try {
         add_location(m_old_index.get(node.id()));
     } catch (...) {
     }
     try {
         add_location(node.location());
     } catch (...) {
     }
 }
开发者ID:mapbox,项目名称:minjur,代码行数:10,代码来源:minjur-generate-tilelist.cpp

示例9: node

 // - walk over all node-versions
 //   - walk over all bboxes
 //     - if the node-id is recorded in the bboxes node-trackers
 //       - send the node to the bboxes writer
 void node(const osmium::Node& node) {
     if (debug) {
         std::cerr << "cut_administrative node " << node.id() << " v" << node.version() << "\n";
     }
     for (const auto& extract : info->extracts) {
         if (extract->node_tracker.get(node.id())){
             extract->write(node);
         }
     }
 }
开发者ID:NDrive,项目名称:osm-history-splitter,代码行数:14,代码来源:cut_administrative.hpp

示例10: ProcessNode

/** warning: caller needs to take care of synchronization! */
void ExtractorCallbacks::ProcessNode(const osmium::Node &input_node,
                                     const ExtractionNode &result_node)
{
    external_memory.all_nodes_list.push_back(
        {static_cast<int>(input_node.location().lat() * COORDINATE_PRECISION),
         static_cast<int>(input_node.location().lon() * COORDINATE_PRECISION),
         static_cast<NodeID>(input_node.id()),
         result_node.barrier,
         result_node.traffic_lights});
}
开发者ID:DINKIN,项目名称:omim,代码行数:11,代码来源:extractor_callbacks.cpp

示例11: ProcessNode

/**
 * Takes the node position from osmium and the filtered properties from the lua
 * profile and saves them to external memory.
 *
 * warning: caller needs to take care of synchronization!
 */
void ExtractorCallbacks::ProcessNode(const osmium::Node &input_node,
                                     const ExtractionNode &result_node)
{
    external_memory.all_nodes_list.push_back(
        {util::toFixed(util::FloatLongitude{input_node.location().lon()}),
         util::toFixed(util::FloatLatitude{input_node.location().lat()}),
         OSMNodeID{static_cast<std::uint64_t>(input_node.id())},
         result_node.barrier,
         result_node.traffic_lights});
}
开发者ID:Anjmao,项目名称:osrm-backend,代码行数:16,代码来源:extractor_callbacks.cpp

示例12: node

 void node(osmium::Node& node) {
     const char* type = node.tags()["highway"];
     if(type)
     if (!strcmp(type, "bus_stop")) {
         const char* name = node.tags()["name"];
         if (name) {
             nodes[node.id()] = name;
         }
     }
 }
开发者ID:harpbold,项目名称:prog2vedes4_fp_hpba,代码行数:10,代码来源:malvin_details.cpp

示例13: node_add

int output_pgsql_t::node_add(osmium::Node const &node)
{
    taglist_t outtags;
    if (m_tagtransform->filter_tags(node, nullptr, nullptr, outtags))
        return 1;

    auto wkb = m_builder.get_wkb_node(node.location());
    expire.from_wkb(wkb.c_str(), node.id());
    m_tables[t_point]->write_row(node.id(), outtags, wkb);

    return 0;
}
开发者ID:openstreetmap,项目名称:osm2pgsql,代码行数:12,代码来源:output-pgsql.cpp

示例14: node

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

        for (const auto& extract : info->extracts) {
            if (extract->node_tracker.get(node.positive_id()) ||
                extract->extra_node_tracker.get(node.positive_id())) {
                extract->write(node);
            }
        }
    }
开发者ID:joto,项目名称:osm-history-splitter,代码行数:16,代码来源:softcut.hpp

示例15: node

        void node(const osmium::Node& node) {
            if (m_max_way_id > 0) {
                throw std::runtime_error("Found a node after a way.");
            }
            if (m_max_relation_id > 0) {
                throw std::runtime_error("Found a node after a relation.");
            }

            if (m_max_node_id >= node.id()) {
                throw std::runtime_error("Node IDs out of order.");
            }
            m_max_node_id = node.id();
        }
开发者ID:Pdegoffau,项目名称:libosmium,代码行数:13,代码来源:check_order.hpp


注:本文中的osmium::Node类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。