1 #ifndef OSMIUM_AREA_PROBLEM_REPORTER_OGR_HPP
2 #define OSMIUM_AREA_PROBLEM_REPORTER_OGR_HPP
47 #include <gdalcpp.hpp>
71 gdalcpp::Feature feature(m_layer_perror, m_ogr_factory.
create_point(location));
72 feature.set_field(
"id1", static_cast<double>(id1));
73 feature.set_field(
"id2", static_cast<double>(id2));
74 feature.set_field(
"problem_type", problem_type);
75 feature.add_to_layer();
79 std::unique_ptr<OGRPoint> ogr_point1 = m_ogr_factory.
create_point(loc1);
80 std::unique_ptr<OGRPoint> ogr_point2 = m_ogr_factory.
create_point(loc2);
81 std::unique_ptr<OGRLineString> ogr_linestring = std::unique_ptr<OGRLineString>(
new OGRLineString());
82 ogr_linestring->addPoint(ogr_point1.get());
83 ogr_linestring->addPoint(ogr_point2.get());
85 gdalcpp::Feature feature(m_layer_lerror, std::move(ogr_linestring));
86 feature.set_field(
"id1", static_cast<double>(id1));
87 feature.set_field(
"id2", static_cast<double>(id2));
88 feature.set_field(
"problem_type", problem_type);
89 feature.add_to_layer();
95 m_layer_perror(dataset,
"perrors", wkbPoint),
96 m_layer_lerror(dataset,
"lerrors", wkbLineString) {
98 m_layer_perror.add_field(
"id1", OFTReal, 10);
99 m_layer_perror.add_field(
"id2", OFTReal, 10);
100 m_layer_perror.add_field(
"problem_type", OFTString, 30);
102 m_layer_lerror.add_field(
"id1", OFTReal, 10);
103 m_layer_lerror.add_field(
"id2", OFTReal, 10);
104 m_layer_lerror.add_field(
"problem_type", OFTString, 30);
110 write_point(
"duplicate_node", node_id1, node_id2, location);
139 #endif // OSMIUM_AREA_PROBLEM_REPORTER_OGR_HPP
void report_role_should_be_outer(osmium::object_id_type way_id, osmium::Location seg_start, osmium::Location seg_end) override
Definition: problem_reporter_ogr.hpp:125
Definition: factory.hpp:146
void write_point(const char *problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location location)
Definition: problem_reporter_ogr.hpp:70
osmium::object_id_type m_object_id
Definition: problem_reporter.hpp:63
void report_intersection(osmium::object_id_type way1_id, osmium::Location way1_seg_start, osmium::Location way1_seg_end, osmium::object_id_type way2_id, osmium::Location way2_seg_start, osmium::Location way2_seg_end, osmium::Location intersection) override
Definition: problem_reporter_ogr.hpp:113
Definition: entity_bits.hpp:67
gdalcpp::Layer m_layer_lerror
Definition: problem_reporter_ogr.hpp:68
ProblemReporterOGR(gdalcpp::Dataset &dataset)
Definition: problem_reporter_ogr.hpp:94
int64_t object_id_type
Type for OSM object (node, way, or relation) IDs.
Definition: types.hpp:45
Namespace for everything in the Osmium library.
Definition: assembler.hpp:59
Definition: problem_reporter.hpp:55
point_type create_point(const osmium::Location &location) const
Definition: factory.hpp:202
void report_duplicate_node(osmium::object_id_type node_id1, osmium::object_id_type node_id2, osmium::Location location) override
Definition: problem_reporter_ogr.hpp:109
void write_line(const char *problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location loc1, osmium::Location loc2)
Definition: problem_reporter_ogr.hpp:78
Definition: problem_reporter_ogr.hpp:63
Definition: location.hpp:79
osmium::geom::OGRFactory m_ogr_factory
Definition: problem_reporter_ogr.hpp:65
gdalcpp::Layer m_layer_perror
Definition: problem_reporter_ogr.hpp:67
virtual ~ProblemReporterOGR()=default
void report_role_should_be_inner(osmium::object_id_type way_id, osmium::Location seg_start, osmium::Location seg_end) override
Definition: problem_reporter_ogr.hpp:129
void report_ring_not_closed(osmium::Location end1, osmium::Location end2) override
Definition: problem_reporter_ogr.hpp:120