Libosmium  2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
Public Member Functions | Private Member Functions | Private Attributes | List of all members
osmium::area::ProblemReporterOGR Class Reference

#include <problem_reporter_ogr.hpp>

Inheritance diagram for osmium::area::ProblemReporterOGR:
Inheritance graph
[legend]
Collaboration diagram for osmium::area::ProblemReporterOGR:
Collaboration graph
[legend]

Public Member Functions

 ProblemReporterOGR (gdalcpp::Dataset &dataset)
 
void report_duplicate_node (osmium::object_id_type node_id1, osmium::object_id_type node_id2, osmium::Location location) override
 
void report_touching_ring (osmium::object_id_type node_id, osmium::Location location) override
 
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
 
void report_duplicate_segment (const osmium::NodeRef &nr1, const osmium::NodeRef &nr2) override
 
void report_overlapping_segment (const osmium::NodeRef &nr1, const osmium::NodeRef &nr2) override
 
void report_ring_not_closed (const osmium::NodeRef &nr, const osmium::Way *way) override
 
void report_role_should_be_outer (osmium::object_id_type way_id, osmium::Location seg_start, osmium::Location seg_end) override
 
void report_role_should_be_inner (osmium::object_id_type way_id, osmium::Location seg_start, osmium::Location seg_end) override
 
void report_way_in_multiple_rings (const osmium::Way &way) override
 
void report_inner_with_same_tags (const osmium::Way &way) override
 
void report_duplicate_way (const osmium::Way &way) override
 
void report_way (const osmium::Way &way) override
 
- Public Member Functions inherited from osmium::area::ProblemReporter
 ProblemReporter ()=default
 
 ProblemReporter (const ProblemReporter &)=default
 
ProblemReporteroperator= (const ProblemReporter &)=default
 
 ProblemReporter (ProblemReporter &&) noexcept=default
 
ProblemReporteroperator= (ProblemReporter &&) noexcept=default
 
virtual ~ProblemReporter () noexcept=default
 
void set_object (osmium::item_type object_type, osmium::object_id_type object_id) noexcept
 
osmium::object_id_type object_id () const noexcept
 
void set_nodes (size_t nodes) noexcept
 
virtual void report_duplicate_node (osmium::object_id_type node_id1, osmium::object_id_type node_id2, osmium::Location location)
 
virtual void report_touching_ring (osmium::object_id_type node_id, osmium::Location location)
 
virtual 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)
 
virtual void report_duplicate_segment (const osmium::NodeRef &nr1, const osmium::NodeRef &nr2)
 
virtual void report_overlapping_segment (const osmium::NodeRef &nr1, const osmium::NodeRef &nr2)
 
virtual void report_ring_not_closed (const osmium::NodeRef &nr, const osmium::Way *way)
 
virtual void report_role_should_be_outer (osmium::object_id_type way_id, osmium::Location seg_start, osmium::Location seg_end)
 
virtual void report_role_should_be_inner (osmium::object_id_type way_id, osmium::Location seg_start, osmium::Location seg_end)
 
virtual void report_way_in_multiple_rings (const osmium::Way &way)
 
virtual void report_inner_with_same_tags (const osmium::Way &way)
 
virtual void report_invalid_location (osmium::object_id_type way_id, osmium::object_id_type node_id)
 
virtual void report_duplicate_way (const osmium::Way &way)
 
virtual void report_way (const osmium::Way &way)
 

Private Member Functions

void set_object (gdalcpp::Feature &feature)
 
void write_point (const char *problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location location)
 
void write_line (const char *problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location loc1, osmium::Location loc2)
 

Private Attributes

osmium::geom::OGRFactory m_ogr_factory
 
gdalcpp::Layer m_layer_perror
 
gdalcpp::Layer m_layer_lerror
 
gdalcpp::Layer m_layer_ways
 

Additional Inherited Members

- Protected Attributes inherited from osmium::area::ProblemReporter
osmium::item_type m_object_type = osmium::item_type::undefined
 
osmium::object_id_type m_object_id = 0
 
size_t m_nodes = 0
 

Detailed Description

Report problems when assembling areas by adding them to layers in an OGR datasource.

Constructor & Destructor Documentation

◆ ProblemReporterOGR()

osmium::area::ProblemReporterOGR::ProblemReporterOGR ( gdalcpp::Dataset &  dataset)
inlineexplicit

Member Function Documentation

◆ report_duplicate_node()

void osmium::area::ProblemReporterOGR::report_duplicate_node ( osmium::object_id_type  node_id1,
osmium::object_id_type  node_id2,
osmium::Location  location 
)
inlineoverridevirtual

Report a duplicate node, ie. two nodes with the same location.

Parameters
node_id1ID of the first node.
node_id2ID of the second node.
locationLocation of both nodes.

Reimplemented from osmium::area::ProblemReporter.

◆ report_duplicate_segment()

void osmium::area::ProblemReporterOGR::report_duplicate_segment ( const osmium::NodeRef nr1,
const osmium::NodeRef nr2 
)
inlineoverridevirtual

Report a duplicate segments. Two or more segments are directly on top of each other. This can be a problem, if there is a spike for instance, or it could be okay, if there are touching inner rings.

Parameters
nr1NodeRef of one end of the segment.
nr2NodeRef of the other end of the segment.

Reimplemented from osmium::area::ProblemReporter.

◆ report_duplicate_way()

void osmium::area::ProblemReporterOGR::report_duplicate_way ( const osmium::Way way)
inlineoverridevirtual

Report a way that is more than once in a relation.

Parameters
wayThe way

Reimplemented from osmium::area::ProblemReporter.

◆ report_inner_with_same_tags()

void osmium::area::ProblemReporterOGR::report_inner_with_same_tags ( const osmium::Way way)
inlineoverridevirtual

Report a way with role inner that has the same tags as the relation or outer ways.

Parameters
wayThe way.

Reimplemented from osmium::area::ProblemReporter.

◆ report_intersection()

void osmium::area::ProblemReporterOGR::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 
)
inlineoverridevirtual

Report an intersection between two segments.

Parameters
way1_idID of the first involved way.
way1_seg_startLocation where the segment of the first way with the intersection starts
way1_seg_endLocation where the segment of the first way with the intersection ends
way2_idID of the second involved way.
way2_seg_startLocation where the segment of the second way with the intersection starts
way2_seg_endLocation where the segment of the second way with the intersection ends
intersectionLocation of the intersection. This might be slightly off the correct location due to rounding.

Reimplemented from osmium::area::ProblemReporter.

◆ report_overlapping_segment()

void osmium::area::ProblemReporterOGR::report_overlapping_segment ( const osmium::NodeRef nr1,
const osmium::NodeRef nr2 
)
inlineoverridevirtual

Report a duplicate segments. Two or more segments are directly on top of each other. This can be a problem, if there is a spike for instance, or it could be okay, if there are touching inner rings.

Parameters
nr1NodeRef of one end of the segment.
nr2NodeRef of the other end of the segment.

Reimplemented from osmium::area::ProblemReporter.

◆ report_ring_not_closed()

void osmium::area::ProblemReporterOGR::report_ring_not_closed ( const osmium::NodeRef nr,
const osmium::Way way 
)
inlineoverridevirtual

Report an open ring.

Parameters
nrNodeRef of one end of the ring.
wayOptional pointer to way the end node is in.

Reimplemented from osmium::area::ProblemReporter.

◆ report_role_should_be_inner()

void osmium::area::ProblemReporterOGR::report_role_should_be_inner ( osmium::object_id_type  way_id,
osmium::Location  seg_start,
osmium::Location  seg_end 
)
inlineoverridevirtual

Report a segment that should have role "inner", but has a different role.

Parameters
way_idID of the way this segment is in.
seg_startStart of the segment with the wrong role.
seg_endEnd of the segment with the wrong role.

Reimplemented from osmium::area::ProblemReporter.

◆ report_role_should_be_outer()

void osmium::area::ProblemReporterOGR::report_role_should_be_outer ( osmium::object_id_type  way_id,
osmium::Location  seg_start,
osmium::Location  seg_end 
)
inlineoverridevirtual

Report a segment that should have role "outer", but has a different role.

Parameters
way_idID of the way this segment is in.
seg_startStart of the segment with the wrong role.
seg_endEnd of the segment with the wrong role.

Reimplemented from osmium::area::ProblemReporter.

◆ report_touching_ring()

void osmium::area::ProblemReporterOGR::report_touching_ring ( osmium::object_id_type  node_id,
osmium::Location  location 
)
inlineoverridevirtual

Report a node/location where rings touch. This is often wrong, but not necessarily so.

Parameters
node_idID of the node.
locationLocation of the node.

Reimplemented from osmium::area::ProblemReporter.

◆ report_way()

void osmium::area::ProblemReporterOGR::report_way ( const osmium::Way way)
inlineoverridevirtual

In addition to reporting specific problems, this is used to report all ways belonging to areas having problems.

Parameters
wayThe way

Reimplemented from osmium::area::ProblemReporter.

◆ report_way_in_multiple_rings()

void osmium::area::ProblemReporterOGR::report_way_in_multiple_rings ( const osmium::Way way)
inlineoverridevirtual

Report a way that is in multiple rings.

Parameters
wayThe way.

Reimplemented from osmium::area::ProblemReporter.

◆ set_object()

void osmium::area::ProblemReporterOGR::set_object ( gdalcpp::Feature &  feature)
inlineprivate

◆ write_line()

void osmium::area::ProblemReporterOGR::write_line ( const char *  problem_type,
osmium::object_id_type  id1,
osmium::object_id_type  id2,
osmium::Location  loc1,
osmium::Location  loc2 
)
inlineprivate

◆ write_point()

void osmium::area::ProblemReporterOGR::write_point ( const char *  problem_type,
osmium::object_id_type  id1,
osmium::object_id_type  id2,
osmium::Location  location 
)
inlineprivate

Member Data Documentation

◆ m_layer_lerror

gdalcpp::Layer osmium::area::ProblemReporterOGR::m_layer_lerror
private

◆ m_layer_perror

gdalcpp::Layer osmium::area::ProblemReporterOGR::m_layer_perror
private

◆ m_layer_ways

gdalcpp::Layer osmium::area::ProblemReporterOGR::m_layer_ways
private

◆ m_ogr_factory

osmium::geom::OGRFactory osmium::area::ProblemReporterOGR::m_ogr_factory
private

The documentation for this class was generated from the following file: