Loading...
Searching...
No Matches
osmium::handler::CheckOrder Class Reference

`#include <check_order.hpp>`

Inheritance diagram for osmium::handler::CheckOrder:
[legend]
Collaboration diagram for osmium::handler::CheckOrder:
[legend]

## Public Member Functions

| CheckOrder (bool with_history=false)
void | node (const osmium::Node &node)
void | way (const osmium::Way &way)
void | relation (const osmium::Relation &relation)
osmium::object_id_type | max_node_id () const noexcept
osmium::object_id_type | max_way_id () const noexcept
osmium::object_id_type | max_relation_id () const noexcept
Public Member Functions inherited from osmium::handler::Handler
void | osm_object (const osmium::OSMObject &) const noexcept
void | node (const osmium::Node &) const noexcept
void | way (const osmium::Way &) const noexcept
void | relation (const osmium::Relation &) const noexcept
void | area (const osmium::Area &) const noexcept
void | changeset (const osmium::Changeset &) const noexcept
void | tag_list (const osmium::TagList &) const noexcept
void | way_node_list (const osmium::WayNodeList &) const noexcept
void | relation_member_list (const osmium::RelationMemberList &) const noexcept
void | outer_ring (const osmium::OuterRing &) const noexcept
void | inner_ring (const osmium::InnerRing &) const noexcept
void | changeset_discussion (const osmium::ChangesetDiscussion &) const noexcept
void | flush () const noexcept

## Private Attributes

osmium::object_id_type | m_max_node_id = 0
osmium::object_id_type | m_max_way_id = 0
osmium::object_id_type | m_max_relation_id = 0
osmium::object_version_type | m_last_version = 0
bool | m_has_node = false
bool | m_has_way = false
bool | m_has_relation = false
bool | m_with_history

## Detailed Description

Handler that can be used to check that an OSM file is ordered correctly. Ordered in this case refers to the usual order in OSM files: First nodes in the order of their IDs, then ways in the order of their IDs, then relations in the order or their IDs. Negative IDs are ordered first then positive IDs, both ordered by absolute value.

Constructor has a single bool parameter. If this is false (default) the check is done for normal OSM data files, i.e. IDs have to be unique for each type. If this is true, the check is done for OSM history files, the combination ID/version has to be unique and the versions need to be in order.

To use this, add a CheckOrder member variable to your handler and call the node(), way(), and relation() methods from your node(), way(), and relations() handlers, respectively. An out_of_order_error exception will be thrown when the input is not in order.

## Constructor & Destructor Documentation

## CheckOrder()

osmium::handler::CheckOrder::CheckOrder | ( | bool | with_history = false | ) |

inline

## Member Function Documentation

## max_node_id()

osmium::object_id_type osmium::handler::CheckOrder::max_node_id | ( |  | ) | const

inlinenoexcept

## max_relation_id()

osmium::object_id_type osmium::handler::CheckOrder::max_relation_id | ( |  | ) | const

inlinenoexcept

## max_way_id()

osmium::object_id_type osmium::handler::CheckOrder::max_way_id | ( |  | ) | const

inlinenoexcept

## node()

void osmium::handler::CheckOrder::node | ( | const osmium::Node & | node | ) |

inline

## relation()

void osmium::handler::CheckOrder::relation | ( | const osmium::Relation & | relation | ) |

inline

## way()

void osmium::handler::CheckOrder::way | ( | const osmium::Way & | way | ) |

inline

## Member Data Documentation

## m_has_node

bool osmium::handler::CheckOrder::m_has_node = false

private

## m_has_relation

bool osmium::handler::CheckOrder::m_has_relation = false

private

## m_has_way

bool osmium::handler::CheckOrder::m_has_way = false

private

## m_last_version

osmium::object_version_type osmium::handler::CheckOrder::m_last_version = 0

private

## m_max_node_id

osmium::object_id_type osmium::handler::CheckOrder::m_max_node_id = 0

private

## m_max_relation_id

osmium::object_id_type osmium::handler::CheckOrder::m_max_relation_id = 0

private

## m_max_way_id

osmium::object_id_type osmium::handler::CheckOrder::m_max_way_id = 0

private

## m_with_history

bool osmium::handler::CheckOrder::m_with_history

private

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

- include/osmium/handler/check_order.hpp