bool create_area(osmium::memory::Buffer& out_buffer, const osmium::Relation& relation, const std::vector<const osmium::Way*>& members) { set_num_members(members.size()); osmium::builder::AreaBuilder builder{out_buffer}; builder.initialize_from_object(relation); const bool area_okay = create_rings(); if (area_okay || config().create_empty_areas) { if (config().keep_type_tag) { builder.add_item(relation.tags()); } else { copy_tags_without_type(builder, relation.tags()); } } if (area_okay) { add_rings_to_area(builder); } if (report_ways()) { for (const osmium::Way* way : members) { config().problem_reporter->report_way(*way); } } return area_okay || config().create_empty_areas; }
/** * Assemble an area from the given way. * * The resulting area is put into the out_buffer. * * @returns false if there was some kind of error building the * area, true otherwise. */ bool operator()(const osmium::Way& way, osmium::memory::Buffer& out_buffer) { segment_list().extract_segments_from_way(config().problem_reporter, stats().duplicate_nodes, way); if (!create_rings()) { return false; } { osmium::builder::AreaBuilder builder{out_buffer}; builder.initialize_from_object(way); add_rings_to_area(builder); } out_buffer.commit(); return true; }
bool create_area(osmium::memory::Buffer& out_buffer, const osmium::Way& way) { osmium::builder::AreaBuilder builder{out_buffer}; builder.initialize_from_object(way); const bool area_okay = create_rings(); if (area_okay || config().create_empty_areas) { builder.add_item(way.tags()); } if (area_okay) { add_rings_to_area(builder); } if (report_ways()) { config().problem_reporter->report_way(way); } return area_okay || config().create_empty_areas; }