Loading...
Searching...
No Matches
osmium::area::ProblemReporter Class Reference

`#include <problem_reporter.hpp>`

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

## Public Member Functions

| ProblemReporter ()=default
| ProblemReporter (const ProblemReporter &)=default
ProblemReporter & | operator= (const ProblemReporter &)=default
| ProblemReporter (ProblemReporter &&) noexcept=default
ProblemReporter & | operator= (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)

## Protected Attributes

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

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

## ProblemReporter() [1/3]

osmium::area::ProblemReporter::ProblemReporter | ( |  | ) |

default

## ProblemReporter() [2/3]

osmium::area::ProblemReporter::ProblemReporter | ( | const ProblemReporter & |  | ) |

default

## ProblemReporter() [3/3]

osmium::area::ProblemReporter::ProblemReporter | ( | ProblemReporter && |  | ) |

default noexcept

## ~ProblemReporter()

virtual osmium::area::ProblemReporter::~ProblemReporter | ( |  | ) |

virtual default noexcept

## Member Function Documentation

## object_id()

osmium::object_id_type osmium::area::ProblemReporter::object_id | ( |  | ) | const

inline noexcept

## operator=() [1/2]

ProblemReporter & osmium::area::ProblemReporter::operator= | ( | const ProblemReporter & |  | ) |

default

## operator=() [2/2]

ProblemReporter & osmium::area::ProblemReporter::operator= | ( | ProblemReporter && |  | ) |

default noexcept

## report_duplicate_node()

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

inline virtual

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

Parameters

  node_id1 | ID of the first node.
  node_id2 | ID of the second node.
  location | Location of both nodes.

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

## report_duplicate_segment()

virtual void osmium::area::ProblemReporter::report_duplicate_segment | ( | const osmium::NodeRef & | nr1,
|  | const osmium::NodeRef & | nr2
| ) |  |

inline virtual

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

  nr1 | NodeRef of one end of the segment.
  nr2 | NodeRef of the other end of the segment.

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

## report_duplicate_way()

virtual void osmium::area::ProblemReporter::report_duplicate_way | ( | const osmium::Way & | way | ) |

inline virtual

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

Parameters

  way | The way

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

## report_inner_with_same_tags()

virtual void osmium::area::ProblemReporter::report_inner_with_same_tags | ( | const osmium::Way & | way | ) |

inline virtual

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

Parameters

  way | The way.

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

## report_intersection()

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
| ) |  |

inline virtual

Report an intersection between two segments.

Parameters

  way1_id | ID of the first involved way.
  way1_seg_start | Location where the segment of the first way with the intersection starts
  way1_seg_end | Location where the segment of the first way with the intersection ends
  way2_id | ID of the second involved way.
  way2_seg_start | Location where the segment of the second way with the intersection starts
  way2_seg_end | Location where the segment of the second way with the intersection ends
  intersection | Location of the intersection. This might be slightly off the correct location due to rounding.

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

## report_invalid_location()

virtual void osmium::area::ProblemReporter::report_invalid_location | ( | osmium::object_id_type | way_id,
|  | osmium::object_id_type | node_id
| ) |  |

inline virtual

Report an invalid location in a way.

Parameters

  way_id | ID of the way the node is in.
  node_id | ID of the node with the invalid location.

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

## report_overlapping_segment()

virtual void osmium::area::ProblemReporter::report_overlapping_segment | ( | const osmium::NodeRef & | nr1,
|  | const osmium::NodeRef & | nr2
| ) |  |

inline virtual

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

  nr1 | NodeRef of one end of the segment.
  nr2 | NodeRef of the other end of the segment.

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

## report_ring_not_closed()

virtual void osmium::area::ProblemReporter::report_ring_not_closed | ( | const osmium::NodeRef & | nr,
|  | const osmium::Way * | way
| ) |  |

inline virtual

Report an open ring.

Parameters

  nr | NodeRef of one end of the ring.
  way | Optional pointer to way the end node is in.

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

## report_role_should_be_inner()

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

inline virtual

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

Parameters

  way_id | ID of the way this segment is in.
  seg_start | Start of the segment with the wrong role.
  seg_end | End of the segment with the wrong role.

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

## report_role_should_be_outer()

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

inline virtual

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

Parameters

  way_id | ID of the way this segment is in.
  seg_start | Start of the segment with the wrong role.
  seg_end | End of the segment with the wrong role.

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

## report_touching_ring()

virtual void osmium::area::ProblemReporter::report_touching_ring | ( | osmium::object_id_type | node_id,
|  | osmium::Location | location
| ) |  |

inline virtual

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

Parameters

  node_id | ID of the node.
  location | Location of the node.

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

## report_way()

virtual void osmium::area::ProblemReporter::report_way | ( | const osmium::Way & | way | ) |

inline virtual

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

Parameters

  way | The way

Reimplemented in osmium::area::ProblemReporterOGR.

## report_way_in_multiple_rings()

virtual void osmium::area::ProblemReporter::report_way_in_multiple_rings | ( | const osmium::Way & | way | ) |

inline virtual

Report a way that is in multiple rings.

Parameters

  way | The way.

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

## set_nodes()

void osmium::area::ProblemReporter::set_nodes | ( | size_t | nodes | ) |

inline noexcept

## set_object()

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

inline noexcept

Set the object the next problem reports will be on.

Parameters

  object_type | The type of the object.
  object_id | The ID of the object.

## Member Data Documentation

## m_nodes

size_t osmium::area::ProblemReporter::m_nodes = 0

protected

## m_object_id

osmium::object_id_type osmium::area::ProblemReporter::m_object_id = 0

protected

## m_object_type

osmium::item_type osmium::area::ProblemReporter::m_object_type = osmium::item_type::undefined

protected

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

- include/osmium/area/problem_reporter.hpp