Libosmium  2.11.0
Fast and flexible C++ library for working with OpenStreetMap data
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
osmium::area::MultipolygonCollector< TAssembler > Class Template Reference

#include <multipolygon_collector.hpp>

Inheritance diagram for osmium::area::MultipolygonCollector< TAssembler >:
Inheritance graph
[legend]
Collaboration diagram for osmium::area::MultipolygonCollector< TAssembler >:
Collaboration graph
[legend]

Public Member Functions

 MultipolygonCollector (const assembler_config_type &assembler_config)
 
const osmium::area::area_statsstats () const noexcept
 
bool keep_relation (const osmium::Relation &relation) const
 
bool keep_member (const osmium::relations::RelationMeta &, const osmium::RelationMember &member) const
 
void way_not_in_any_relation (const osmium::Way &way)
 
void complete_relation (osmium::relations::RelationMeta &relation_meta)
 
void flush ()
 
osmium::memory::Buffer read ()
 
- Public Member Functions inherited from osmium::relations::Collector< MultipolygonCollector< TAssembler >, false, true, false >
 Collector ()
 
uint64_t used_memory () const
 
HandlerPass2 & handler (const callback_func_type &callback=nullptr)
 
osmium::memory::Buffermembers_buffer ()
 
bool is_available (osmium::item_type type, osmium::object_id_type id)
 
size_t get_offset (osmium::item_type type, osmium::object_id_type id)
 
std::pair< bool, size_t > get_availability_and_offset (osmium::item_type type, osmium::object_id_type id)
 
void read_relations (TIter begin, TIter end)
 
void read_relations (TSource &source)
 
void moving_in_buffer (size_t old_offset, size_t new_offset)
 
void possibly_purge_removed_members ()
 
std::vector< const
osmium::Relation * > 
get_incomplete_relations () const
 

Private Types

using collector_type = osmium::relations::Collector< MultipolygonCollector< TAssembler >, false, true, false >
 
using assembler_config_type = typename TAssembler::config_type
 

Private Member Functions

void flush_output_buffer ()
 
void possibly_flush_output_buffer ()
 

Private Attributes

const assembler_config_type m_assembler_config
 
osmium::memory::Buffer m_output_buffer
 
osmium::area::area_stats m_stats
 

Static Private Attributes

static constexpr size_t initial_output_buffer_size = 1024 * 1024
 
static constexpr size_t max_buffer_size_for_flush = 100 * 1024
 

Additional Inherited Members

- Protected Member Functions inherited from osmium::relations::Collector< MultipolygonCollector< TAssembler >, false, true, false >
std::vector< MemberMeta > & member_meta (const item_type type)
 
callback_func_type callback ()
 
const std::vector< RelationMeta > & relations () const
 
bool keep_relation (const osmium::Relation &) const
 
bool keep_member (const osmium::relations::RelationMeta &, const osmium::RelationMember &) const
 
void node_not_in_any_relation (const osmium::Node &)
 
void way_not_in_any_relation (const osmium::Way &)
 
void relation_not_in_any_relation (const osmium::Relation &)
 
void flush ()
 
void clean_assembled_relations ()
 
const osmium::Relationget_relation (size_t offset) const
 
const osmium::Relationget_relation (const RelationMeta &relation_meta) const
 
const osmium::Relationget_relation (const MemberMeta &member_meta) const
 
osmium::OSMObjectget_member (size_t offset) const
 

Detailed Description

template<typename TAssembler>
class osmium::area::MultipolygonCollector< TAssembler >

This class collects all data needed for creating areas from relations tagged with type=multipolygon or type=boundary. Most of its functionality is derived from the parent class osmium::relations::Collector.

The actual assembling of the areas is done by the assembler class given as template argument.

Template Parameters
TAssemblerMultipolygon Assembler class.
Precondition
The Ids of all objects must be unique in the input data.

Member Typedef Documentation

template<typename TAssembler>
using osmium::area::MultipolygonCollector< TAssembler >::assembler_config_type = typename TAssembler::config_type
private
template<typename TAssembler>
using osmium::area::MultipolygonCollector< TAssembler >::collector_type = osmium::relations::Collector<MultipolygonCollector<TAssembler>, false, true, false>
private

Constructor & Destructor Documentation

template<typename TAssembler>
osmium::area::MultipolygonCollector< TAssembler >::MultipolygonCollector ( const assembler_config_type assembler_config)
inlineexplicit

Member Function Documentation

template<typename TAssembler>
void osmium::area::MultipolygonCollector< TAssembler >::complete_relation ( osmium::relations::RelationMeta &  relation_meta)
inline
template<typename TAssembler>
void osmium::area::MultipolygonCollector< TAssembler >::flush ( )
inline
template<typename TAssembler>
void osmium::area::MultipolygonCollector< TAssembler >::flush_output_buffer ( )
inlineprivate
template<typename TAssembler>
bool osmium::area::MultipolygonCollector< TAssembler >::keep_member ( const osmium::relations::RelationMeta &  ,
const osmium::RelationMember member 
) const
inline

Overwritten from the base class.

template<typename TAssembler>
bool osmium::area::MultipolygonCollector< TAssembler >::keep_relation ( const osmium::Relation relation) const
inline

We are interested in all relations tagged with type=multipolygon or type=boundary.

Overwritten from the base class.

template<typename TAssembler>
void osmium::area::MultipolygonCollector< TAssembler >::possibly_flush_output_buffer ( )
inlineprivate
template<typename TAssembler>
osmium::memory::Buffer osmium::area::MultipolygonCollector< TAssembler >::read ( )
inline
template<typename TAssembler>
const osmium::area::area_stats& osmium::area::MultipolygonCollector< TAssembler >::stats ( ) const
inlinenoexcept
template<typename TAssembler>
void osmium::area::MultipolygonCollector< TAssembler >::way_not_in_any_relation ( const osmium::Way way)
inline

This is called when a way is not in any multipolygon relation.

Overwritten from the base class.

Member Data Documentation

template<typename TAssembler>
constexpr size_t osmium::area::MultipolygonCollector< TAssembler >::initial_output_buffer_size = 1024 * 1024
staticprivate
template<typename TAssembler>
const assembler_config_type osmium::area::MultipolygonCollector< TAssembler >::m_assembler_config
private
template<typename TAssembler>
osmium::memory::Buffer osmium::area::MultipolygonCollector< TAssembler >::m_output_buffer
private
template<typename TAssembler>
osmium::area::area_stats osmium::area::MultipolygonCollector< TAssembler >::m_stats
private
template<typename TAssembler>
constexpr size_t osmium::area::MultipolygonCollector< TAssembler >::max_buffer_size_for_flush = 100 * 1024
staticprivate

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