/**
  * This is called when a way is not in any multipolygon
  * relation.
  *
  * Overwritten from the base class.
  */
 void way_not_in_any_relation(const osmium::Way& way) {
     if (way.nodes().size() > 3 && way.ends_have_same_location()) {
         // way is closed and has enough nodes, build simple multipolygon
         try {
             TAssembler assembler(m_assembler_config);
             assembler(way, m_output_buffer);
             possibly_flush_output_buffer();
         } catch (osmium::invalid_location&) {
             // XXX ignore
         }
     }
 }
 /**
  * This is called when a way is not in any multipolygon
  * relation.
  */
 void way_not_in_any_relation(const osmium::Way& way) {
     // you need at least 4 nodes to make up a polygon
     if (way.nodes().size() <= 3) {
         return;
     }
     try {
         if (!way.nodes().front().location() || !way.nodes().back().location()) {
             throw osmium::invalid_location{"invalid location"};
         }
         if (way.ends_have_same_location()) {
             // way is closed and has enough nodes, build simple multipolygon
             TAssembler assembler{m_assembler_config};
             assembler(way, this->buffer());
             m_stats += assembler.stats();
         }
     } catch (const osmium::invalid_location&) {
         // XXX ignore
     }
 }
Exemplo n.º 3
0
 /**
  * This is called when a way is not in any multipolygon
  * relation.
  *
  * Overwritten from the base class.
  */
 void way_not_in_any_relation(const osmium::Way& way) {
     // you need at least 4 nodes to make up a polygon
     if (way.nodes().size() <= 3) {
         return;
     }
     try {
         if (!way.nodes().front().location() || !way.nodes().back().location()) {
             throw osmium::invalid_location("invalid location");
         }
         if (way.ends_have_same_location()) {
             // way is closed and has enough nodes, build simple multipolygon
             TAssembler assembler(m_assembler_config);
             assembler(way, m_output_buffer);
             possibly_flush_output_buffer();
         }
     } catch (osmium::invalid_location&) {
         // XXX ignore
     }
 }