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

#include <problem_reporter.hpp>

Inheritance diagram for osmium::area::ProblemReporter:
Inheritance graph
[legend]

Public Member Functions

 ProblemReporter ()=default
 
virtual ~ProblemReporter ()=default
 
void set_object (osmium::item_type object_type, osmium::object_id_type object_id) noexcept
 
virtual void report_duplicate_node (osmium::object_id_type node_id1, osmium::object_id_type node_id2, 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_ring_not_closed (osmium::Location end1, osmium::Location end2)
 
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)
 

Protected Attributes

osmium::item_type m_object_type
 
osmium::object_id_type m_object_id
 

Detailed Description

When assembling a multipolygon/area from a multipolygon relation or a closed way several problems can be detected. This includes intersections between lines, wrong role attributes on relation members etc. These problems are reported by the area::Assembler class to the ProblemReporter class or one of its child classes.

This is the parent class which does nothing with the reports. Child classes are expected to implement different ways of reporting the problems.

Constructor & Destructor Documentation

osmium::area::ProblemReporter::ProblemReporter ( )
default
virtual osmium::area::ProblemReporter::~ProblemReporter ( )
virtualdefault

Member Function Documentation

virtual void osmium::area::ProblemReporter::report_duplicate_node ( osmium::object_id_type  node_id1,
osmium::object_id_type  node_id2,
osmium::Location  location 
)
inlinevirtual

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 in osmium::area::ProblemReporterOGR, osmium::area::ProblemReporterStream, and osmium::area::ProblemReporterException.

virtual void osmium::area::ProblemReporter::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 
)
inlinevirtual

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 in osmium::area::ProblemReporterOGR, osmium::area::ProblemReporterStream, and osmium::area::ProblemReporterException.

virtual void osmium::area::ProblemReporter::report_ring_not_closed ( osmium::Location  end1,
osmium::Location  end2 
)
inlinevirtual

Report an open ring.

Parameters
end1Location of the first open end.
end2Location of the second open end.

Reimplemented in osmium::area::ProblemReporterOGR, osmium::area::ProblemReporterStream, and osmium::area::ProblemReporterException.

virtual void osmium::area::ProblemReporter::report_role_should_be_inner ( osmium::object_id_type  way_id,
osmium::Location  seg_start,
osmium::Location  seg_end 
)
inlinevirtual

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 in osmium::area::ProblemReporterOGR, osmium::area::ProblemReporterStream, and osmium::area::ProblemReporterException.

virtual void osmium::area::ProblemReporter::report_role_should_be_outer ( osmium::object_id_type  way_id,
osmium::Location  seg_start,
osmium::Location  seg_end 
)
inlinevirtual

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 in osmium::area::ProblemReporterOGR, osmium::area::ProblemReporterStream, and osmium::area::ProblemReporterException.

void osmium::area::ProblemReporter::set_object ( osmium::item_type  object_type,
osmium::object_id_type  object_id 
)
inlinenoexcept

Set the object the next problem reports will be on.

Parameters
object_typeThe type of the object.
object_idThe ID of the object.

Member Data Documentation

osmium::object_id_type osmium::area::ProblemReporter::m_object_id
protected
osmium::item_type osmium::area::ProblemReporter::m_object_type
protected

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