osmium::area::Assembler Class Reference

`#include <assembler.hpp>`

Collaboration diagram for osmium::area::Assembler:
[legend]

## Classes

struct | MPFilter

## Public Types

typedef osmium::area::AssemblerConfig | config_type

## Public Member Functions

| Assembler (const config_type &config)
| ~Assembler ()=default
void | operator() (const osmium::Way &way, osmium::memory::Buffer &out_buffer)
void | operator() (const osmium::Relation &relation, const std::vector< size_t > &members, const osmium::memory::Buffer &in_buffer, osmium::memory::Buffer &out_buffer)

## Private Member Functions

bool | debug () const
bool | has_same_location (const osmium::NodeRef &nr1, const osmium::NodeRef &nr2)
void | add_tags_to_area (osmium::builder::AreaBuilder &builder, const osmium::Way &way) const
void | add_common_tags (osmium::builder::TagListBuilder &tl_builder, std::set< const osmium::Way * > &ways) const
void | add_tags_to_area (osmium::builder::AreaBuilder &builder, const osmium::Relation &relation) const
bool | check_for_open_rings ()
bool | possibly_combine_rings_back (ProtoRing &ring)
bool | possibly_combine_rings_front (ProtoRing &ring)
void | split_off_subring (osmium::area::detail::ProtoRing &ring, osmium::area::detail::ProtoRing::segments_type::iterator it, osmium::area::detail::ProtoRing::segments_type::iterator it_begin, osmium::area::detail::ProtoRing::segments_type::iterator it_end)
bool | has_closed_subring_back (ProtoRing &ring, const NodeRef &nr)
bool | has_closed_subring_front (ProtoRing &ring, const NodeRef &nr)
bool | check_for_closed_subring (ProtoRing &ring)
void | combine_rings_front (const osmium::area::detail::NodeRefSegment &segment, ProtoRing &ring)
void | combine_rings_back (const osmium::area::detail::NodeRefSegment &segment, ProtoRing &ring)
void | add_rings_to_area (osmium::builder::AreaBuilder &builder) const
bool | add_to_existing_ring (osmium::area::detail::NodeRefSegment segment)
void | check_inner_outer (ProtoRing &ring)
void | check_inner_outer_roles ()
bool | create_rings ()

## Static Private Member Functions

static MPFilter & | filter ()

## Private Attributes

const AssemblerConfig | m_config
osmium::area::detail::SegmentList | m_segment_list
std::list< ProtoRing > | m_rings
std::vector< ProtoRing * > | m_outer_rings
std::vector< ProtoRing * > | m_inner_rings
int | m_inner_outer_mismatches { 0 }

## Detailed Description

Assembles area objects from multipolygon relations and their members. This is called by the MultipolygonCollector object after all members have been collected.

## Member Typedef Documentation

typedef osmium::area::AssemblerConfig osmium::area::Assembler::config_type

## Constructor & Destructor Documentation

osmium::area::Assembler::Assembler | ( | const config_type & | config | ) |

inline explicit

osmium::area::Assembler::~Assembler | ( |  | ) |

default

## Member Function Documentation

void osmium::area::Assembler::add_common_tags | ( | osmium::builder::TagListBuilder & | tl_builder,
|  | std::set< const osmium::Way * > & | ways
| ) |  | const

inline private

void osmium::area::Assembler::add_rings_to_area | ( | osmium::builder::AreaBuilder & | builder | ) | const

inline private

Append each outer ring together with its inner rings to the area in the buffer.

void osmium::area::Assembler::add_tags_to_area | ( | osmium::builder::AreaBuilder & | builder,
|  | const osmium::Way & | way
| ) |  | const

inline private

void osmium::area::Assembler::add_tags_to_area | ( | osmium::builder::AreaBuilder & | builder,
|  | const osmium::Relation & | relation
| ) |  | const

inline private

bool osmium::area::Assembler::add_to_existing_ring | ( | osmium::area::detail::NodeRefSegment | segment | ) |

inline private

bool osmium::area::Assembler::check_for_closed_subring | ( | ProtoRing & | ring | ) |

inline private

bool osmium::area::Assembler::check_for_open_rings | ( |  | ) |

inline private

Go through all the rings and find rings that are not closed. Problems are reported through the problem reporter.

Returns
  true if any rings were not closed, false otherwise

void osmium::area::Assembler::check_inner_outer | ( | ProtoRing & | ring | ) |

inline private

void osmium::area::Assembler::check_inner_outer_roles | ( |  | ) |

inline private

void osmium::area::Assembler::combine_rings_back | ( | const osmium::area::detail::NodeRefSegment & | segment,
|  | ProtoRing & | ring
| ) |  |

inline private

void osmium::area::Assembler::combine_rings_front | ( | const osmium::area::detail::NodeRefSegment & | segment,
|  | ProtoRing & | ring
| ) |  |

inline private

bool osmium::area::Assembler::create_rings | ( |  | ) |

inline private

Create rings from segments.

bool osmium::area::Assembler::debug | ( |  | ) | const

inline private

static MPFilter& osmium::area::Assembler::filter | ( |  | ) |

inline static private

bool osmium::area::Assembler::has_closed_subring_back | ( | ProtoRing & | ring,
|  | const NodeRef & | nr
| ) |  |

inline private

bool osmium::area::Assembler::has_closed_subring_front | ( | ProtoRing & | ring,
|  | const NodeRef & | nr
| ) |  |

inline private

bool osmium::area::Assembler::has_same_location | ( | const osmium::NodeRef & | nr1,
|  | const osmium::NodeRef & | nr2
| ) |  |

inline private

Checks whether the given NodeRefs have the same location. Uses the actual location for the test, not the id. If both have the same location, but not the same id, a problem point will be added to the list of problem points.

void osmium::area::Assembler::operator() | ( | const osmium::Way & | way,
|  | osmium::memory::Buffer & | out_buffer
| ) |  |

inline

Assemble an area from the given way. The resulting area is put into the out_buffer.

void osmium::area::Assembler::operator() | ( | const osmium::Relation & | relation,
|  | const std::vector< size_t > & | members,
|  | const osmium::memory::Buffer & | in_buffer,
|  | osmium::memory::Buffer & | out_buffer
| ) |  |

inline

Assemble an area from the given relation and its members. All members are to be found in the in_buffer at the offsets given by the members parameter. The resulting area is put into the out_buffer.

bool osmium::area::Assembler::possibly_combine_rings_back | ( | ProtoRing & | ring | ) |

inline private

Check whether there are any rings that can be combined with the given ring to one larger ring by appending the other ring to the end of this ring. If the rings can be combined they are and the function returns true.

bool osmium::area::Assembler::possibly_combine_rings_front | ( | ProtoRing & | ring | ) |

inline private

Check whether there are any rings that can be combined with the given ring to one larger ring by prepending the other ring to the start of this ring. If the rings can be combined they are and the function returns true.

void osmium::area::Assembler::split_off_subring | ( | osmium::area::detail::ProtoRing & | ring,
|  | osmium::area::detail::ProtoRing::segments_type::iterator | it,
|  | osmium::area::detail::ProtoRing::segments_type::iterator | it_begin,
|  | osmium::area::detail::ProtoRing::segments_type::iterator | it_end
| ) |  |

inline private

## Member Data Documentation

const AssemblerConfig osmium::area::Assembler::m_config

private

int osmium::area::Assembler::m_inner_outer_mismatches { 0 }

private

std::vector<ProtoRing*> osmium::area::Assembler::m_inner_rings

private

std::vector<ProtoRing*> osmium::area::Assembler::m_outer_rings

private

std::list<ProtoRing> osmium::area::Assembler::m_rings

private

osmium::area::detail::SegmentList osmium::area::Assembler::m_segment_list

private

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

- osmium/area/assembler.hpp