/**
 * \brief maps navteq tags for access, tunnel, bridge, etc. to osm tags
 * \return link id of processed feature.
 */
link_id_type parse_street_tags(osmium::builder::TagListBuilder *builder, ogr_feature_uptr& f, cdms_map_type* cdms_map =
        nullptr, cnd_mod_map_type* cnd_mod_map = nullptr, area_id_govt_code_map_type* area_govt_map = nullptr,
        cntry_ref_map_type* cntry_map = nullptr) {
    const char* link_id_s = get_field_from_feature(f, LINK_ID);
    link_id_type link_id = std::stoul(link_id_s);
    builder->add_tag(LINK_ID, link_id_s); // tag for debug purpose

    builder->add_tag("name", to_camel_case_with_spaces(get_field_from_feature(f, ST_NAME)).c_str());
    if (is_ferry(get_field_from_feature(f, FERRY))) {
        add_ferry_tag(builder, f);
    } else {  // usual highways
        add_highway_tags(builder, f, link_id, cdms_map, cnd_mod_map);
    }

    area_id_type l_area_id = get_uint_from_feature(f, L_AREA_ID);
    area_id_type r_area_id = get_uint_from_feature(f, R_AREA_ID);
    // tags which apply to highways and ferry routes
    add_additional_restrictions(builder, link_id, l_area_id, r_area_id, cdms_map, cnd_mod_map, area_govt_map,
            cntry_map);
    add_here_speed_cat_tag(builder, f);
    if (parse_bool(get_field_from_feature(f, TOLLWAY))) builder->add_tag("here:tollway", YES);
    if (parse_bool(get_field_from_feature(f, URBAN))) builder->add_tag("here:urban", YES);
    std::string route_type = get_field_from_feature(f, ROUTE);
    if (!route_type.empty()) builder->add_tag("here:route_type", route_type.c_str());

    std::string func_class = get_field_from_feature(f, FUNC_CLASS);
    if (!func_class.empty()) builder->add_tag("here:func_class", func_class.c_str());


    return link_id;
}
/**
 * \brief duplicate const char* value to change
 */
std::string to_camel_case_with_spaces(const char* camel) {
    std::string s(camel);
    to_camel_case_with_spaces(s);
    return s;
}
Beispiel #3
0
/**
 * \brief apply camel case with spaces to string
 */
std::string to_camel_case_with_spaces(std::string camel) {
    return to_camel_case_with_spaces(camel.c_str());
}