Loading...
Searching...
No Matches
stats.hpp
Go to the documentation of this file.
#ifndef OSMIUM_AREA_STATS_HPP
#define OSMIUM_AREA_STATS_HPP
/*
This file is part of Osmium (https://osmcode.org/libosmium).
Copyright 2013-2026 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#include <cstdint>
#include <ostream>
namespace osmium {
namespace area {
struct area_stats {
uint64_t area_really_complex_case = 0;
uint64_t area_simple_case = 0;
uint64_t area_touching_rings_case = 0;
uint64_t duplicate_nodes = 0;
uint64_t duplicate_segments = 0;
uint64_t duplicate_ways = 0;
uint64_t from_relations = 0;
uint64_t from_ways = 0;
uint64_t inner_rings = 0;
uint64_t inner_with_same_tags = 0;
uint64_t intersections = 0;
uint64_t member_ways = 0;
uint64_t no_tags_on_relation = 0;
uint64_t no_way_in_mp_relation = 0;
uint64_t nodes = 0;
uint64_t open_rings = 0;
uint64_t outer_rings = 0;
uint64_t overlapping_segments = 0;
uint64_t short_ways = 0;
uint64_t single_way_in_mp_relation = 0;
uint64_t touching_rings = 0;
uint64_t ways_in_multiple_rings = 0;
uint64_t wrong_role = 0;
uint64_t invalid_locations = 0;
area_stats& operator+=(const area_stats& other) noexcept {
area_really_complex_case += other.area_really_complex_case;
area_simple_case += other.area_simple_case;
area_touching_rings_case += other.area_touching_rings_case;
duplicate_nodes += other.duplicate_nodes;
duplicate_segments += other.duplicate_segments;
duplicate_ways += other.duplicate_ways;
from_relations += other.from_relations;
from_ways += other.from_ways;
inner_rings += other.inner_rings;
inner_with_same_tags += other.inner_with_same_tags;
intersections += other.intersections;
member_ways += other.member_ways;
no_tags_on_relation += other.no_tags_on_relation;
no_way_in_mp_relation += other.no_way_in_mp_relation;
nodes += other.nodes;
open_rings += other.open_rings;
outer_rings += other.outer_rings;
short_ways += other.short_ways;
single_way_in_mp_relation += other.single_way_in_mp_relation;
touching_rings += other.touching_rings;
ways_in_multiple_rings += other.ways_in_multiple_rings;
wrong_role += other.wrong_role;
invalid_locations += invalid_locations;
return *this;
}
}; // struct area_stats
template <typename TChar, typename TTraits>
inline std::basic_ostream<TChar, TTraits>& operator<<(std::basic_ostream<TChar, TTraits>& out, const area_stats& s) {
return out << " area_really_complex_case=" << s.area_really_complex_case
<< " area_simple_case=" << s.area_simple_case
<< " area_touching_rings_case=" << s.area_touching_rings_case
<< " duplicate_nodes=" << s.duplicate_nodes
<< " duplicate_segments=" << s.duplicate_segments
<< " duplicate_ways=" << s.duplicate_ways
<< " from_relations=" << s.from_relations
<< " from_ways=" << s.from_ways
<< " inner_rings=" << s.inner_rings
<< " inner_with_same_tags=" << s.inner_with_same_tags
<< " intersections=" << s.intersections
<< " member_ways=" << s.member_ways
<< " no_tags_on_relation=" << s.no_tags_on_relation
<< " no_way_in_mp_relation=" << s.no_way_in_mp_relation
<< " nodes=" << s.nodes
<< " open_rings=" << s.open_rings
<< " outer_rings=" << s.outer_rings
<< " short_ways=" << s.short_ways
<< " single_way_in_mp_relation=" << s.single_way_in_mp_relation
<< " touching_rings=" << s.touching_rings
<< " ways_in_multiple_rings=" << s.ways_in_multiple_rings
<< " wrong_role=" << s.wrong_role
<< " invalid_locations=" << s.invalid_locations;
}
} // namespace area
} // namespace osmium
#endif // OSMIUM_AREA_STATS_HPP
osmium::area
Code related to the building of areas (multipolygons) from relations.
Definition assembler.hpp:55
osmium::area::operator<<
std::basic_ostream< TChar, TTraits > & operator<<(std::basic_ostream< TChar, TTraits > &out, const area_stats &s)
Definition stats.hpp:105
osmium
Namespace for everything in the Osmium library.
Definition assembler.hpp:53
osmium::area::area_stats
Definition stats.hpp:49
osmium::area::area_stats::invalid_locations
uint64_t invalid_locations
Invalid location found.
Definition stats.hpp:73
osmium::area::area_stats::duplicate_ways
uint64_t duplicate_ways
Ways that are in relation more than once.
Definition stats.hpp:55
osmium::area::area_stats::touching_rings
uint64_t touching_rings
Rings touching in a node.
Definition stats.hpp:70
osmium::area::area_stats::from_ways
uint64_t from_ways
Area created from way.
Definition stats.hpp:57
osmium::area::area_stats::inner_rings
uint64_t inner_rings
Number of inner rings.
Definition stats.hpp:58
osmium::area::area_stats::intersections
uint64_t intersections
Number of intersections between segments.
Definition stats.hpp:60
osmium::area::area_stats::area_simple_case
uint64_t area_simple_case
Simple case, no touching rings.
Definition stats.hpp:51
osmium::area::area_stats::operator+=
area_stats & operator+=(const area_stats &other) noexcept
Definition stats.hpp:75
osmium::area::area_stats::duplicate_segments
uint64_t duplicate_segments
Segments duplicated (going back and forth)
Definition stats.hpp:54
osmium::area::area_stats::nodes
uint64_t nodes
Number of nodes in the area.
Definition stats.hpp:64
osmium::area::area_stats::ways_in_multiple_rings
uint64_t ways_in_multiple_rings
Different segments of a way ended up in different rings.
Definition stats.hpp:71
osmium::area::area_stats::duplicate_nodes
uint64_t duplicate_nodes
Consecutive identical nodes or consecutive nodes with same location.
Definition stats.hpp:53
osmium::area::area_stats::single_way_in_mp_relation
uint64_t single_way_in_mp_relation
Multipolygon relation containing a single way.
Definition stats.hpp:69
osmium::area::area_stats::inner_with_same_tags
uint64_t inner_with_same_tags
Number of inner ways with same tags as area.
Definition stats.hpp:59
osmium::area::area_stats::open_rings
uint64_t open_rings
Number of open rings in the area.
Definition stats.hpp:65
osmium::area::area_stats::no_tags_on_relation
uint64_t no_tags_on_relation
No tags on relation (old-style multipolygon with tags on outer ways)
Definition stats.hpp:62
osmium::area::area_stats::short_ways
uint64_t short_ways
Number of ways with less than two nodes.
Definition stats.hpp:68
osmium::area::area_stats::area_touching_rings_case
uint64_t area_touching_rings_case
More difficult case with touching rings.
Definition stats.hpp:52
osmium::area::area_stats::area_really_complex_case
uint64_t area_really_complex_case
Most difficult case with rings touching in multiple points.
Definition stats.hpp:50
osmium::area::area_stats::no_way_in_mp_relation
uint64_t no_way_in_mp_relation
Multipolygon relation with no way members.
Definition stats.hpp:63
osmium::area::area_stats::outer_rings
uint64_t outer_rings
Number of outer rings in the area.
Definition stats.hpp:66
osmium::area::area_stats::member_ways
uint64_t member_ways
Number of ways in the area.
Definition stats.hpp:61
osmium::area::area_stats::wrong_role
uint64_t wrong_role
Member has wrong role (not "outer", "inner", or empty)
Definition stats.hpp:72
osmium::area::area_stats::overlapping_segments
uint64_t overlapping_segments
Three or more segments with same end points.
Definition stats.hpp:67
osmium::area::area_stats::from_relations
uint64_t from_relations
Area created from multipolygon relation.
Definition stats.hpp:56