1#ifndef OSMIUM_AREA_MULTIPOLYGON_COLLECTOR_HPP
2#define OSMIUM_AREA_MULTIPOLYGON_COLLECTOR_HPP
76 template <
typename TAssembler>
101 this->
callback()(std::move(buffer));
130 const char*
type = relation.tags().get_value_by_key(
"type");
137 return (!std::strcmp(
type,
"multipolygon")) || (!std::strcmp(
type,
"boundary"));
156 if (way.nodes().size() <= 3) {
160 if (!way.nodes().front().location() || !way.nodes().back().location()) {
163 if (way.ends_have_same_location()) {
179 std::vector<const osmium::Way*> ways;
180 ways.reserve(relation.members().size());
181 for (
const auto& member : relation.members()) {
182 if (member.ref() != 0) {
183 const size_t offset = this->
get_offset(member.type(), member.ref());
184 ways.push_back(&buffer.get<
const osmium::Way>(offset));
202 osmium::memory::Buffer
read() {
Definition: relation.hpp:56
item_type type() const noexcept
Definition: relation.hpp:125
Definition: relation.hpp:161
Definition: multipolygon_collector.hpp:77
bool keep_member(const osmium::relations::RelationMeta &, const osmium::RelationMember &member) const
Definition: multipolygon_collector.hpp:143
osmium::memory::Buffer read()
Definition: multipolygon_collector.hpp:202
bool keep_relation(const osmium::Relation &relation) const
Definition: multipolygon_collector.hpp:129
@ max_buffer_size_for_flush
Definition: multipolygon_collector.hpp:93
const area_stats & stats() const noexcept
Definition: multipolygon_collector.hpp:119
void possibly_flush_output_buffer()
Definition: multipolygon_collector.hpp:105
void complete_relation(const osmium::relations::RelationMeta &relation_meta)
Definition: multipolygon_collector.hpp:175
typename TAssembler::config_type assembler_config_type
Definition: multipolygon_collector.hpp:81
void flush_output_buffer()
Definition: multipolygon_collector.hpp:96
MultipolygonCollector(const assembler_config_type &assembler_config)
Definition: multipolygon_collector.hpp:113
area_stats m_stats
Definition: multipolygon_collector.hpp:86
void way_not_in_any_relation(const osmium::Way &way)
Definition: multipolygon_collector.hpp:154
const assembler_config_type m_assembler_config
Definition: multipolygon_collector.hpp:82
void flush()
Definition: multipolygon_collector.hpp:198
@ initial_output_buffer_size
Definition: multipolygon_collector.hpp:89
osmium::memory::Buffer m_output_buffer
Definition: multipolygon_collector.hpp:84
Definition: collector.hpp:98
osmium::memory::Buffer & members_buffer()
Definition: collector.hpp:484
const osmium::Relation & get_relation(size_t offset) const
Definition: collector.hpp:301
size_t get_offset(osmium::item_type type, osmium::object_id_type id)
Definition: collector.hpp:514
callback_func_type callback()
Definition: collector.hpp:222
type
Definition: entity_bits.hpp:63
@ area
Definition: entity_bits.hpp:72
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: location.hpp:53